mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-13 17:14:10 -08:00
7 lines
1.7 KiB
JavaScript
7 lines
1.7 KiB
JavaScript
|
/*
|
||
|
* bootstrap-table - v1.9.1 - 2015-10-25
|
||
|
* https://github.com/wenzhixin/bootstrap-table
|
||
|
* Copyright (c) 2015 zhixin wen
|
||
|
* Licensed MIT License
|
||
|
*/
|
||
|
!function(a){"use strict";var b=function(a,b){return{id:"customId_"+b}};a.extend(a.fn.bootstrapTable.defaults,{reorderableRows:!1,onDragStyle:null,onDropStyle:null,onDragClass:"reorder_rows_onDragClass",dragHandle:null,useRowAttrFunc:!1,onReorderRowsDrag:function(){return!1},onReorderRowsDrop:function(){return!1},onReorderRow:function(){return!1}}),a.extend(a.fn.bootstrapTable.Constructor.EVENTS,{"reorder-row.bs.table":"onReorderRow"});var c=a.fn.bootstrapTable.Constructor,d=c.prototype.init,e=c.prototype.initSearch;c.prototype.init=function(){if(this.options.reorderableRows){var a=this;this.options.useRowAttrFunc&&(this.options.rowAttributes=b);var c=this.options.onPostBody;this.options.onPostBody=function(){setTimeout(function(){a.makeRowsReorderable(),c.apply()},1)},d.apply(this,Array.prototype.slice.apply(arguments))}},c.prototype.initSearch=function(){e.apply(this,Array.prototype.slice.apply(arguments)),!this.options.reorderableRows},c.prototype.makeRowsReorderable=function(){if(!this.options.cardView){var a=this;this.$el.tableDnD({onDragStyle:a.options.onDragStyle,onDropStyle:a.options.onDropStyle,onDragClass:a.options.onDragClass,onDrop:a.onDrop,onDragStart:a.options.onReorderRowsDrag,dragHandle:a.options.dragHandle})}},c.prototype.onDrop=function(b,c){for(var d=a(b),e=d.data("bootstrap.table"),f=d.data("bootstrap.table").options,g=null,h=[],i=0;i<b.tBodies[0].rows.length;i++)g=a(b.tBodies[0].rows[i]),h.push(f.data[g.data("index")]),g.data("index",i).attr("data-index",i);f.data=h,f.onReorderRowsDrop.apply(b,[b,c]),e.trigger("reorder-row",h)}}(jQuery);
|