mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Fix resizable widget bindings after tablesorter updateAll event
After updating tablesorter with updateAll event it will reinitalize all widget, but resizable initalized only once internally and there after it was not possible to change columns widths.
This commit is contained in:
parent
73153f2bdf
commit
b73162d0c0
@ -102,10 +102,8 @@
|
||||
.bind( 'selectstart', false );
|
||||
}
|
||||
}
|
||||
$table.one('tablesorter-initialized', function() {
|
||||
ts.resizable.setHandlePosition( c, wo );
|
||||
ts.resizable.bindings( this.config, this.config.widgetOptions );
|
||||
});
|
||||
ts.resizable.bindings( c, wo );
|
||||
},
|
||||
|
||||
updateStoredSizes : function( c, wo ) {
|
||||
@ -188,9 +186,9 @@
|
||||
},
|
||||
|
||||
// prevent text selection while dragging resize bar
|
||||
toggleTextSelection : function( c, toggle ) {
|
||||
toggleTextSelection : function( c, wo, toggle ) {
|
||||
var namespace = c.namespace + 'tsresize';
|
||||
c.widgetOptions.resizable_vars.disabled = toggle;
|
||||
wo.resizable_vars.disabled = toggle;
|
||||
$( 'body' ).toggleClass( ts.css.resizableNoSelect, toggle );
|
||||
if ( toggle ) {
|
||||
$( 'body' )
|
||||
@ -227,7 +225,7 @@
|
||||
|
||||
vars.mouseXPosition = event.pageX;
|
||||
ts.resizable.updateStoredSizes( c, wo );
|
||||
ts.resizable.toggleTextSelection( c, true );
|
||||
ts.resizable.toggleTextSelection(c, wo, true );
|
||||
});
|
||||
|
||||
$( document )
|
||||
@ -246,7 +244,7 @@
|
||||
})
|
||||
.bind( 'mouseup' + namespace, function() {
|
||||
if (!wo.resizable_vars.disabled) { return; }
|
||||
ts.resizable.toggleTextSelection( c, false );
|
||||
ts.resizable.toggleTextSelection( c, wo, false );
|
||||
ts.resizable.stopResize( c, wo );
|
||||
ts.resizable.setHandlePosition( c, wo );
|
||||
});
|
||||
@ -351,7 +349,7 @@
|
||||
.unbind( 'contextmenu' + namespace );
|
||||
|
||||
wo.$resizable_container.remove();
|
||||
ts.resizable.toggleTextSelection( c, false );
|
||||
ts.resizable.toggleTextSelection( c, wo, false );
|
||||
ts.resizableReset( table, refreshing );
|
||||
$( document ).unbind( 'mousemove' + namespace + ' mouseup' + namespace );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user