Initial refactor of rigboard template

This commit is contained in:
2020-03-09 22:44:46 +00:00
parent 1e5fcbdba0
commit 320c43e472
54 changed files with 52 additions and 17111 deletions

View File

@@ -1 +0,0 @@
$(document).ready(function(){function t(e){targetObject=$("#"+e.attr("id")+"-update"),update_url=$("option:selected",e).data("update_url"),""==update_url?targetObject.attr("disabled",!0):(targetObject.attr("href",update_url),targetObject.attr("disabled",!1))}clearSelectionLabel="(no selection)",$(".selectpicker").each(function(){var e={ajax:{url:$(this).data("sourceurl"),type:"GET",dataType:"json",data:{term:"{{{q}}}"}},locale:{emptyTitle:""},clearOnEmpty:!1,preprocessData:function(e){var t,a=e.length,l=[];if(l.push({text:clearSelectionLabel,value:"",data:{update_url:"",subtext:""}}),a)for(t=0;t<a;t++)l.push($.extend(!0,e[t],{text:e[t].label,value:e[t].pk,data:{update_url:e[t].update,subtext:""}}));return l}};$(this).prepend($("<option></option>").attr("value","").text(clearSelectionLabel).data("update_url","")),$(this).selectpicker().ajaxSelectPicker(e),$(this).change(function(){t($(this))}),t($(this))}),$("#modal").on("hide.bs.modal",function(e){var t,a,l,r;null!=modaltarget&&""!=modalobject&&(t=$(modaltarget),a=modalobject[0].pk,l=modalobject[0].fields.name,r=modalobject[0].update_url,t.find("option").remove(),t.append($("<option></option>").attr("value",a).text(l).data("update_url",r)),t.selectpicker("render"),t.selectpicker("refresh"),t.selectpicker("val",a),t.change())})});