diff options
author | Scott González <scott.gonzalez@gmail.com> | 2008-06-27 13:07:05 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2008-06-27 13:07:05 +0000 |
commit | 0c1af7a99ac7137ce7b3e9e0cf6cb11c686e1ed8 (patch) | |
tree | 7a2f10a927d92b6cfddd710293cb911ede27dce3 | |
parent | 42487ffbb1fa4e9c5d3df1a4cfea45092384ff8d (diff) | |
download | jquery-ui-0c1af7a99ac7137ce7b3e9e0cf6cb11c686e1ed8.tar.gz jquery-ui-0c1af7a99ac7137ce7b3e9e0cf6cb11c686e1ed8.zip |
Tabs: Fixed parameters in dispatched events.
-rw-r--r-- | ui/ui.tabs.js | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/ui/ui.tabs.js b/ui/ui.tabs.js index 2b778873a..e6381578d 100644 --- a/ui/ui.tabs.js +++ b/ui/ui.tabs.js @@ -134,7 +134,7 @@ $.widget("ui.tabs", { // seems to be expected behavior that the show callback is fired var onShow = function() { $(self.element).triggerHandler('tabsshow', - [null, self.ui(self.$tabs[o.selected], self.$panels[o.selected])], o.show); + [self.fakeEvent('tabsshow'), self.ui(self.$tabs[o.selected], self.$panels[o.selected])], o.show); }; // load if remote tab @@ -198,7 +198,7 @@ $.widget("ui.tabs", { // callback $(self.element).triggerHandler('tabsshow', - [null, self.ui(clicked, $show[0])], o.show); + [self.fakeEvent('tabsshow'), self.ui(clicked, $show[0])], o.show); }); } @@ -228,7 +228,7 @@ $.widget("ui.tabs", { if (($li.hasClass(o.selectedClass) && !o.unselect) || $li.hasClass(o.disabledClass) || $(this).hasClass(o.loadingClass) - || $(self.element).triggerHandler('tabsselect', [null, self.ui(this, $show[0])], o.select) === false + || $(self.element).triggerHandler('tabsselect', [self.fakeEvent('tabsselect'), self.ui(this, $show[0])], o.select) === false ) { this.blur(); return false; @@ -354,7 +354,7 @@ $.widget("ui.tabs", { // callback this.element.triggerHandler('tabsadd', - [null, this.ui(this.$tabs[index], this.$panels[index])], o.add + [this.fakeEvent('tabsadd'), this.ui(this.$tabs[index], this.$panels[index])], o.add ); }, remove: function(index) { @@ -373,7 +373,7 @@ $.widget("ui.tabs", { // callback this.element.triggerHandler('tabsremove', - [null, this.ui($li.find('a')[0], $panel[0])], o.remove + [this.fakeEvent('tabsremove'), this.ui($li.find('a')[0], $panel[0])], o.remove ); }, enable: function(index) { @@ -393,7 +393,7 @@ $.widget("ui.tabs", { // callback this.element.triggerHandler('tabsenable', - [null, this.ui(this.$tabs[index], this.$panels[index])], o.enable + [this.fakeEvent('tabsenable'), this.ui(this.$tabs[index], this.$panels[index])], o.enable ); }, @@ -407,7 +407,7 @@ $.widget("ui.tabs", { // callback this.element.triggerHandler('tabsdisable', - [null, this.ui(this.$tabs[index], this.$panels[index])], o.disable + [this.fakeEvent('tabsdisable'), this.ui(this.$tabs[index], this.$panels[index])], o.disable ); } }, @@ -461,7 +461,7 @@ $.widget("ui.tabs", { // callbacks $(self.element).triggerHandler('tabsload', - [null, self.ui(self.$tabs[index], self.$panels[index])], o.load + [self.fakeEvent('tabsload'), self.ui(self.$tabs[index], self.$panels[index])], o.load ); o.ajaxOptions.success && o.ajaxOptions.success(r, s); @@ -505,6 +505,12 @@ $.widget("ui.tabs", { $(this).removeClass([o.selectedClass, o.unselectClass, o.disabledClass, o.panelClass, o.hideClass].join(' ')); }); + }, + fakeEvent: function(type) { + return $.event.fix({ + type: type, + target: this.element[0] + }); } }); |