Created
December 12, 2012 23:04
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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