snipe-it/public/js/dist/bootstrap-table-simple-view.js

2 lines
6.8 KiB
JavaScript
Raw Normal View History

!function(t){"use strict";var o=t.fn.bootstrapTable.utils.sprintf;t.extend(t.fn.bootstrapTable.defaults,{stickyHeader:!1});var e=3;try{e=parseInt(t.fn.dropdown.Constructor.VERSION,10)}catch(t){}var a=e>3?"d-none":"hidden",i=t.fn.bootstrapTable.Constructor,s=i.prototype.initHeader;i.prototype.initHeader=function(){function e(o){var e=o.data,s=e.find("thead").attr("id");if(e.length<1||t("#"+r).length<1)return t(window).off("resize."+r),t(window).off("scroll."+r),void e.closest(".fixed-table-container").find(".fixed-table-body").off("scroll."+r);var d="0";n.options.stickyHeaderOffsetY&&(d=n.options.stickyHeaderOffsetY.replace("px",""));var l=t(window).scrollTop(),f=t("#"+p).offset().top-d,u=t("#"+h).offset().top-d-t("#"+s).css("height").replace("px","");if(l>f&&l<=u){t.each(n.$stickyHeader.find("tr").eq(0).find("th"),function(o,e){t(e).css("min-width",t("#"+s+" tr").eq(0).find("th").eq(o).css("width"))}),t("#"+c).removeClass(a).addClass("fix-sticky fixed-table-container"),t("#"+c).css("top",d+"px");var b=t('<div style="position:absolute;width:100%;overflow-x:hidden;" />');t("#"+c).html(b.append(n.$stickyHeader)),i(o)}else t("#"+c).removeClass("fix-sticky").addClass(a)}function i(o){var e=o.data,a=e.find("thead").attr("id");t("#"+c).css("width",+e.closest(".fixed-table-body").css("width").replace("px","")+1),t("#"+c+" thead").parent().scrollLeft(Math.abs(t("#"+a).position().left))}var n=this;if(s.apply(this,Array.prototype.slice.apply(arguments)),this.options.stickyHeader){var d=this.$tableBody.find("table"),r=d.attr("id"),l=d.attr("id")+"-sticky-header",c=l+"-sticky-header-container",p=l+"_sticky_anchor_begin",h=l+"_sticky_anchor_end";d.before(o('<div id="%s" class="%s"></div>',c,a)),d.before(o('<div id="%s"></div>',p)),d.after(o('<div id="%s"></div>',h)),d.find("thead").attr("id",l),this.$stickyHeader=t(t("#"+l).clone(!0,!0)),this.$stickyHeader.removeAttr("id"),t(window).on("resize."+r,d,e),t(window).on("scroll."+r,d,e),d.closest(".fixed-table-container").find(".fixed-table-body").on("scroll."+r,d,i),this.$el.on("all.bs.table",function(o){n.$stickyHeader=t(t("#"+l).clone(!0,!0)),n.$stickyHeader.removeAttr("id")})}}}(jQuery),function(t){"use strict";var o=!1,e=t.fn.bootstrapTable.utils.sprintf,a=function(o,a,s,n){if(t("#avdSearchModal_"+n.options.idTable).hasClass("modal"))t("#avdSearchModal_"+n.options.idTable).modal();else{var d=e('<div id="avdSearchModal%s" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">',"_"+n.options.idTable);d+='<div class="modal-dialog modal-xs">',d+=' <div class="modal-content">',d+=' <div class="modal-header">',d+=' <button type="button" class="close" data-dismiss="modal" aria-hidden="true" >&times;</button>',d+=e(' <h4 class="modal-title">%s</h4>',a),d+=" </div>",d+=' <div class="modal-body modal-body-custom">',d+=e(' <div class="container-fluid" id="avdSearchModalContent%s" style="padding-right: 0px;padding-left: 0px;" >',"_"+n.options.idTable),d+=" </div>",d+=" </div>",d+=" </div>",d+=" </div>",d+="</div>",t("body").append(t(d));var r=i(o,s,n),l=0;t("#avdSearchModalContent_"+n.options.idTable).append(r.join("")),t("#"+n.options.idForm).off("keyup blur","input").on("keyup blur","input",function(t){clearTimeout(l),l=setTimeout(function(){n.onColumnAdvancedSearch(t)},n.options.searchTimeOut)}),t("#btnCloseAvd_"+n.options.idTable).click(function(){t("#avdSearchModal_"+n.options.idTable).modal("hide")}),t("#avdSearchModal_"+n.options.idTable).modal()}},i=function(t,o,a){var i=[];i.push(e('<form class="form-horizontal" id="%s" action="%s" >',a.options.idForm,a.options.actionForm));for(var s in t){var n=t[s];!n.checkbox&&n.visible&&n.searchable&&(i.push('<div class="form-group">'),i.push(e('<label class="col-sm-4 control-label">%s</label>',n.title)),i.push('<div class="col-sm-6">'),i.push(e('<input type="text" class="form-control input-md" name="%s" placeholder="%s" id="%s">',n.field,n.title,n.field)),i.push("</div>"),i.push("</div>"))}return i.push('<div class="form-group">'),i.push('<div class="col-sm-offset-9 col-sm-3">'),i.push(e