Bug 1042910 - [gaia-components] Fix stopPropagation in attach.js

I like the preventDefault solution. I just don't know the reason for
keeping the return false feature.


On Tue, Jul 29, 2014 at 4:39 PM, justindarc <notifications@github.com>
wrote:

> In index.js:
>
> > -          if (out === false) { return e.stopPropagation(); }
> > +
> > +          // If the callback returns `false`,
> > +          // call `preventDefault` and
> > +          // `stopPropagation` on the event
> > +          // to preserve expected behavior.
> > +          if (fn.call(ctx || el, e, el) === false) {
> > +            e.preventDefault();
> > +            e.stopPropagation();
> > +            return;
> > +          }
> > +
> > +          // If one of the delegates called
> > +          // `stopPropagation` on the event,
> > +          // stop calling remaining delegates.
> > +          if (e.cancelBubble) { return; }
>
> Yeah, I know.. It's generally frowned upon. However, it's probably a good
> idea to keep since it allows delegates to behave exactly like regular event
> handlers would in the browser using addEventListener.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/gaia-components/attach/pull/1/files#r15531223>.
>