/* * bootstrap-table - v1.11.1 - 2017-02-22 * https://github.com/wenzhixin/bootstrap-table * Copyright (c) 2017 zhixin wen * Licensed MIT License */ !function(a){"use strict";var b=!1,c=function(b){var c=b.$sortModal.selector,d=c.substr(1);if(!a(d).hasClass("modal")){var e=' ",a("body").append(a(e)),b.$sortModal=a(c);var f=b.$sortModal.find("tbody > tr");if(b.$sortModal.off("click","#add").on("click","#add",function(){var a=b.$sortModal.find(".multi-sort-name:first option").length,c=b.$sortModal.find("tbody tr").length;a>c&&(c++,b.addLevel(),b.setButtonStates())}),b.$sortModal.off("click","#delete").on("click","#delete",function(){var a=b.$sortModal.find(".multi-sort-name:first option").length,c=b.$sortModal.find("tbody tr").length;c>1&&a>=c&&(c--,b.$sortModal.find("tbody tr:last").remove(),b.setButtonStates())}),b.$sortModal.off("click",".btn-primary").on("click",".btn-primary",function(){var c=b.$sortModal.find("tbody > tr"),d=b.$sortModal.find("div.alert"),e=[],f=[];b.options.sortPriority=a.map(c,function(b){var c=a(b),d=c.find(".multi-sort-name").val(),f=c.find(".multi-sort-order").val();return e.push(d),{sortName:d,sortOrder:f}});for(var g=e.sort(),h=0;h0)0===d.length&&(d='",a(d).insertBefore(b.$sortModal.find(".bars")));else{if(1===d.length&&a(d).remove(),b.$sortModal.modal("hide"),b.options.sortName="","server"===b.options.sidePagination)return b.options.queryParams=function(a){return a.multiSort=b.options.sortPriority,a},void b.initServer(b.options.silentSort);b.onMultipleSort()}}),(null===b.options.sortPriority||0===b.options.sortPriority.length)&&b.options.sortName&&(b.options.sortPriority=[{sortName:b.options.sortName,sortOrder:b.options.sortOrder}]),null!==b.options.sortPriority&&b.options.sortPriority.length>0){if(f.length.btn-group").first(),h=this.$toolbar.find("div.multi-sort");h.length||(h=' ",g.append(h),c(d)),this.$el.on("sort.bs.table",function(){b=!0}),this.$el.on("multiple-sort.bs.table",function(){b=!1}),this.$el.on("load-success.bs.table",function(){b||null===d.options.sortPriority||"object"!=typeof d.options.sortPriority||"server"===d.options.sidePagination||d.onMultipleSort()}),this.$el.on("column-switch.bs.table",function(a,b){for(var e=0;eb?1:b>a?-1:0},d=function(d,e){for(var f=[],g=[],h=0;h").append(a("").text(d)).append(a("").append(a(''))));var e=this.$sortModal.find(".multi-sort-name").last(),f=this.$sortModal.find(".multi-sort-order").last();a.each(this.columns,function(a,b){return b.sortable===!1||b.visible===!1?!0:void e.append('")}),a.each(this.options.formatSortOrders(),function(a,b){f.append('")}),void 0!==c&&(e.find('option[value="'+c.sortName+'"]').attr("selected",!0),f.find('option[value="'+c.sortOrder+'"]').attr("selected",!0))},d.prototype.assignSortableArrows=function(){for(var b=this,c=b.$header.find("th"),d=0;d1&&this.$sortModal.find("#delete").removeAttr("disabled"),a>b&&this.$sortModal.find("#add").removeAttr("disabled"),1==b&&this.$sortModal.find("#delete").attr("disabled","disabled")}}(jQuery);