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

Fix empty and invalid strings for class functions #44

Closed henryruhs closed 9 years ago

henryruhs commented 9 years ago

jBone suffers on a syntax error SyntaxError: An invalid or illegal string was specified while using empty classes or invalid classes for addClass(), removeClass(), toggleClass() and hasClass()...

Check out the updated attributes.js and testing suite.

  1. I wondered why you not using the native classList.toggle() for your toggleClass() method
  2. I reordered the hasClass testing according to the position in attributes.js
kupriyanenko commented 9 years ago

Hi @redaxmedia,

I'm not using native classList.toggle implementation because not all browsers support second parameters force, for example mobile safari.