aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2009-01-03 04:38:20 +0000
committerScott González <scott.gonzalez@gmail.com>2009-01-03 04:38:20 +0000
commited1b6ded97188f3647a61c99927ac5c4c6faf0ca (patch)
treedbc6cec1ecb636e4f5fce65b32d00c9f130ba7c0 /ui
parent18734a6f9d8baa2e69acc118f1b62e46661c119c (diff)
downloadjquery-ui-ed1b6ded97188f3647a61c99927ac5c4c6faf0ca.tar.gz
jquery-ui-ed1b6ded97188f3647a61c99927ac5c4c6faf0ca.zip
Widget factory: Updated ._trigger to use new event system in jQuery 1.3.
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.core.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index 9432777d6..02e848dc4 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -372,10 +372,17 @@ $.widget.prototype = {
},
_trigger: function(type, event, data) {
- var eventName = (type == this.widgetEventPrefix
- ? type : this.widgetEventPrefix + type);
- event = event || $.event.fix({ type: eventName, target: this.element[0] });
- return this.element.triggerHandler(eventName, [event, data], this.options[type]);
+ var callback = this.options[type],
+ eventName = (type == this.widgetEventPrefix
+ ? type : this.widgetEventPrefix + type);
+
+ event = event ? $.event.fix(event) : $.Event();
+ event.type = eventName;
+
+ this.element.trigger(event, data);
+
+ return !(callback && callback.call(this.element[0], event, data) === false
+ || event.isDefaultPrevented());
}
};