Commit 90921926 authored by Julien Cigar's avatar Julien Cigar
Browse files

added DOM.removeClass

parent 16671dbe
......@@ -39,6 +39,7 @@
src.replace(/^\s+|\s+$/g,'');
}
/***********************************************************************
XMLHttpRequest
************************************************************************/
......@@ -409,6 +410,24 @@
elem.className = values.join(' ');
}
/* Yeti.DOM.removeClass
* Remove a class from an element.
*/
Yeti.DOM.removeClass = function(elem, value) {
if (elem.className) {
var values = value.split(' '),
new_cls = elem.className
;
for (var i=0, _len=values.length; i<_len; i++) {
new_cls = new_cls.replace(values[i], ' ');
}
elem.className = Yeti.Str.trim(new_cls.replace(/\s{2,}/g, ' '))
}
}
/***********************************************************************
Tools
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment