Skip to content
Browse files

unbind before bind. Fixes issue #119

  • Loading branch information...
1 parent 905ff6c commit 373e85078add345926cddd9b301cd3c0d72b0a08 @Mottie committed Aug 19, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 js/jquery.tablesorter.js
View
9 js/jquery.tablesorter.js
@@ -545,7 +545,9 @@
if (!c.delayInit) { buildCache(this); }
// apply event handling to headers
// this is to big, perhaps break it out?
- $headers.bind('mousedown.tablesorter mouseup.tablesorter', function(e, external) {
+ $headers
+ .unbind('mousedown.tablesorter mouseup.tablesorter')
+ .bind('mousedown.tablesorter mouseup.tablesorter', function(e, external) {
// only recognize left clicks
if ((e.which || e.button) !== 1) { return false; }
// set timer on mousedown
@@ -664,6 +666,7 @@
}
// apply easy methods that trigger binded events
$this
+ .unbind('update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave')
.bind("update", function(e, resort, callback) {
// remove rows/elements before update
$(c.selectorRemove, this).remove();
@@ -769,7 +772,9 @@
// show processesing icon
if (c.showProcessing) {
- $this.bind('sortBegin sortEnd', function(e) {
+ $this
+ .unbind('sortBegin sortEnd')
+ .bind('sortBegin sortEnd', function(e) {
ts.isProcessing($this[0], e.type === 'sortBegin');
});
}

0 comments on commit 373e850

Please sign in to comment.
Something went wrong with that request. Please try again.