kupriyanenko / jbone

JavaScript Library for Events and DOM manipulation. Replaces jQuery for Backbone (2.5kb gzipped)
http://jbone.js.org
MIT License
279 stars 35 forks source link

IE 11 raises error in jBone.contains function #41

Closed budarin closed 9 years ago

budarin commented 9 years ago

jBone.contains = function(container, contained) { var result; container.reverse().some(function(el) { if (el.contains(contained)) { //<------ error: Object doesn't support property or method 'contains' return result = el; } }); return result; };

budarin commented 9 years ago

sorry it's my bug. Please delete the issue

kupriyanenko commented 9 years ago

Hi @budarin, ok, thanks.

alexandrbig commented 9 years ago

Hello, actually I have the same issue in IE11. What was the solution to fix it?

version jBone v1.0.28

budarin commented 9 years ago

Sorry, I don't remember the context but it was not the library's problem

kupriyanenko commented 9 years ago

Hi @alexandrbig,

Could you show example of usage .contains.

alexandrbig commented 9 years ago

http://screencast.com/t/qS1SDLUa

I've added $(document).on(...) and it calls dispatch method.

alexandrbig commented 9 years ago

It seems that my issue is not the same, but similar I've got error in line 399:

(el !== e.target && el.contains(e.target))

alexandrbig commented 9 years ago

Hello, the problem is in absense of contains method for document in IE but document.body has this method. So $(document).on(...) may not work in IE but $(document.body).on(...) will do.