app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js in jquery-datatables-1.10.15 vs app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js in jquery-datatables-1.10.16

- old
+ new

@@ -1,17 +1,17 @@ -/*! ColReorder 1.3.3 - * ©2010-2015 SpryMedia Ltd - datatables.net/license +/*! ColReorder 1.4.1 + * ©2010-2017 SpryMedia Ltd - datatables.net/license */ /** * @summary ColReorder * @description Provide the ability to reorder columns in a DataTable - * @version 1.3.3 + * @version 1.4.1 * @file dataTables.colReorder.js * @author SpryMedia Ltd (www.sprymedia.co.uk) * @contact www.sprymedia.co.uk/contact - * @copyright Copyright 2010-2014 SpryMedia Ltd. + * @copyright Copyright 2010-2017 SpryMedia Ltd. * * This source file is free software, available under the following license: * MIT license - http://datatables.net/license/mit * * This source file is distributed in the hope that it will be useful, but @@ -887,11 +887,10 @@ "_fnMouseListener": function ( i, nTh ) { var that = this; $(nTh) .on( 'mousedown.ColReorder', function (e) { - e.preventDefault(); that._fnMouseDown.call( that, e, nTh ); } ) .on( 'touchstart.ColReorder', function (e) { that._fnMouseDown.call( that, e, nTh ); } ); @@ -1258,11 +1257,11 @@ * ColReorder version * @constant version * @type String * @default As code */ -ColReorder.version = "1.3.3"; +ColReorder.version = "1.4.1"; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * DataTables interfaces @@ -1344,9 +1343,16 @@ $.fn.dataTable.Api.register( 'colReorder.transpose()', function ( idx, dir ) { return this.context.length && this.context[0]._colReorder ? this.context[0]._colReorder.fnTranspose( idx, dir ) : idx; +} ); + +$.fn.dataTable.Api.register( 'colReorder.move()', function( from, to, drop, invalidateRows ) { + if (this.context.length) { + this.context[0]._colReorder.s.dt.oInstance.fnColReorder( from, to, drop, invalidateRows ); + } + return this; } ); return ColReorder; }));