You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
9.1 KiB
Plaintext

11 months ago
/*
* 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=' <div class="modal fade" id="'+d+'" tabindex="-1" role="dialog" aria-labelledby="'+d+'Label" aria-hidden="true">';e+=' <div class="modal-dialog">',e+=' <div class="modal-content">',e+=' <div class="modal-header">',e+=' <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>',e+=' <h4 class="modal-title" id="'+d+'Label">'+b.options.formatMultipleSort()+"</h4>",e+=" </div>",e+=' <div class="modal-body">',e+=' <div class="bootstrap-table">',e+=' <div class="fixed-table-toolbar">',e+=' <div class="bars">',e+=' <div id="toolbar">',e+=' <button id="add" type="button" class="btn btn-default"><i class="'+b.options.iconsPrefix+" "+b.options.icons.plus+'"></i> '+b.options.formatAddLevel()+"</button>",e+=' <button id="delete" type="button" class="btn btn-default" disabled><i class="'+b.options.iconsPrefix+" "+b.options.icons.minus+'"></i> '+b.options.formatDeleteLevel()+"</button>",e+=" </div>",e+=" </div>",e+=" </div>",e+=' <div class="fixed-table-container">',e+=' <table id="multi-sort" class="table">',e+=" <thead>",e+=" <tr>",e+=" <th></th>",e+=' <th><div class="th-inner">'+b.options.formatColumn()+"</div></th>",e+=' <th><div class="th-inner">'+b.options.formatOrder()+"</div></th>",e+=" </tr>",e+=" </thead>",e+=" <tbody></tbody>",e+=" </table>",e+=" </div>",e+=" </div>",e+=" </div>",e+=' <div class="modal-footer">',e+=' <button type="button" class="btn btn-default" data-dismiss="modal">'+b.options.formatCancel()+"</button>",e+=' <button type="button" class="btn btn-primary">'+b.options.formatSort()+"</button>",e+=" </div>",e+=" </div>",e+=" </div>",e+=" </div>",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;h<e.length-1;h++)g[h+1]==g[h]&&f.push(g[h]);if(f.length>0)0===d.length&&(d='<div class="alert alert-danger" role="alert"><strong>'+b.options.formatDuplicateAlertTitle()+"</strong> "+b.options.formatDuplicateAlertDescription()+"</div>",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);