Skip to content

Instantly share code, notes, and snippets.

@lsmith
Created December 12, 2012 23:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lsmith/4272500 to your computer and use it in GitHub Desktop.
Save lsmith/4272500 to your computer and use it in GitHub Desktop.
Potential patch for 'tap' synthetic event's notifier custom event to allow e.preventDefault() or e.stopPropagation() to have that effect on the subsequent 'click' event.
notifier.handle.evt.fire = function (e) {
var subs = this._subscribers.concat(this._afters),
args = Y.Array(arguments, 0, true),
i, len, halt;
for (i = 0, len = subs.length; i < len; ++i) {
halt = subs[i].notify(args, this);
// stopImmediatePropagation
if (halt === false || e.stopped > 1) {
break;
}
}
if (e.prevented || e.stopped) {
e.target.once('click', function (clickEvt) {
e.prevented && clickEvt.preventDefault();
e.stopped && clickEvt[e.stopped === 2 ? 'stopImmediatePropagation' : 'stopPropagation']();
})
}
return !!this.stopped;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment