Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option in Bliss.full to exclude addEventListener hijacking #173

Open
nevf opened this issue Feb 25, 2016 · 5 comments
Open

Add option in Bliss.full to exclude addEventListener hijacking #173

nevf opened this issue Feb 25, 2016 · 5 comments

Comments

@nevf
Copy link

nevf commented Feb 25, 2016

I'm stuck with using jQuery and would still like to use the _ property on elements and arrays, However if I use Bliss Full I'm running into various issues with addEventListener etc. hijacking.

One way to resolve this is to add a new option: Bliss.NoHijack and wrap if ( !Bliss.NoHijack ){...} around the addEventListener and removeEventListener hijack code. And use <script>self.Bliss = { NoHijack: true };</script> in the html file before bliss loads.

@LeaVerou
Copy link
Owner

We need to think a bit more about the name, but I like the idea.

@LeaVerou
Copy link
Owner

One problem is that it's not enough to add the option and wrap the hijacking with a conditional. The parts that assume hijacking around the code would also need to change (mainly the event-related functions, e.g. unbind).

@nevf
Copy link
Author

nevf commented Feb 25, 2016

@LeaVerou I've diff'd bliss.shy.js and bliss.js and can't see any difference except the additional code at the end if bliss.js. In other words I can't see any code in unbind() that knows about the hijacking code.

@LeaVerou
Copy link
Owner

Yes, because those parts in Bliss Shy are there regardless, and check if the _ property is available before executing. Eventually they should be moved to Bliss Full and use hooks.
Any code that uses this._.bliss.listeners depends on the hijacking.

@nevf
Copy link
Author

nevf commented Feb 25, 2016

@LeaVerou Ok I understand now. For my use case I can avoid using event() and ``unbind()` as I already have this functionality in code I've written.

That said I can't see that event() add's anything to listeners and if I'm right unbind() won't be affected. ie. It is only the hook functions that add/remove listeners items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants