diff options
-rw-r--r-- | ui/ui.core.js | 15 |
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()); } }; |