Use classList, make !k.WeEabo0o happy.

This commit is contained in:
Nicolas Stepien 2011-08-28 05:51:24 +02:00
parent c7caf31895
commit 97f3d2fc21
2 changed files with 6 additions and 6 deletions

View File

@ -379,10 +379,10 @@
return el.hidden = false;
},
addClass: function(el, className) {
return el.className += ' ' + className;
return el.classList.add(className);
},
removeClass: function(el, className) {
return el.className = el.className.replace(' ' + className, '');
return el.classList.remove(className);
},
rm: function(el) {
return el.parentNode.removeChild(el);
@ -1618,7 +1618,7 @@
}
},
toggle: function(thread) {
if (thread.className.indexOf('stub') !== -1 || thread.hidden) {
if (thread.classList.contains('stub') || thread.hidden) {
return threadHiding.show(thread);
} else {
return threadHiding.hide(thread);

View File

@ -258,9 +258,9 @@ $.extend $,
show: (el) ->
el.hidden = false
addClass: (el, className) ->
el.className += ' ' + className
el.classList.add className
removeClass: (el, className) ->
el.className = el.className.replace ' ' + className, ''
el.classList.remove className
rm: (el) ->
el.parentNode.removeChild el
append: (parent, children...) ->
@ -1311,7 +1311,7 @@ threadHiding =
threadHiding.show thread
toggle: (thread) ->
if thread.className.indexOf('stub') != -1 or thread.hidden
if thread.classList.contains('stub') or thread.hidden
threadHiding.show thread
else
threadHiding.hide thread