commit 7ee4ec66d96ffd601964ed08712a11414f070ecc Author: Kiphaas7 Date: Thu Aug 30 20:10:58 2012 +0800 events diff --git a/core/misc/tableheader.js b/core/misc/tableheader.js index c5cb1ac..f56536a 100644 --- a/core/misc/tableheader.js +++ b/core/misc/tableheader.js @@ -193,7 +193,7 @@ $.extend(TableHeader.prototype, { this.recalculateSticky(); // Let other scripts know a sticky table header was created. - this.$stickyTable.trigger('stickyTableCreated'); + this.$stickyTable.trigger('stickyTableCreated', this); }, /** diff --git a/core/misc/tableselect.js b/core/misc/tableselect.js index 67d1178..935f98f 100644 --- a/core/misc/tableselect.js +++ b/core/misc/tableselect.js @@ -67,7 +67,7 @@ function tableSelectRemoveHander (context) { $table.removeClass('table-select-processed'); // Trigger an event letting other scripts know TableSelect was removed. - $table.trigger('TableSelectRemoved'); + $table.trigger('TableSelectRemoved', tables[i]); // Remove the entry from cache. TableSelect.tables.splice(index, 1); @@ -170,16 +170,16 @@ $.extend(TableSelect.prototype, { this.$table.on('click.TableSelect', 'td input:checkbox', {TableSelect: this}, this.toggleCheckbox); // Let other scripts know a 'select all' checkbox was created. - this.$table.trigger('TableSelectCreated'); + this.$table.trigger('TableSelectCreated', this); }, - adaptToSticky: function (e) { + adaptToSticky: function (e, tableHeader) { var self = e.data.TableSelect; var $stickyTable = self.$table.prev('table.sticky-header'); // If there is a sticky table header attached to the current table, add the // sticky table 'select all' checkbox to the cached 'select all' selector. - if ($stickyTable.length) { + if ($stickyTable.length && $stickyTable[0] === tableHeader.$stickyTable[0]) { var $stickyCheckbox = $stickyTable.find('th.select-all input:checkbox'); self.$selectAll = $([self.$selectAll[0], $stickyCheckbox[0]]); }