Skip to content
Permalink
Browse files

Widget factory: Updated ._trigger to use new event system in jQuery 1.3.

  • Loading branch information...
scottgonzalez committed Jan 3, 2009
1 parent 18734a6 commit ed1b6ded97188f3647a61c99927ac5c4c6faf0ca
Showing with 11 additions and 4 deletions.
  1. +11 −4 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());
}
};

0 comments on commit ed1b6de

Please sign in to comment.
You can’t perform that action at this time.