From 97f3d2fc2147e748de3b34cdca67aa2730c3f044 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 28 Aug 2011 05:51:24 +0200 Subject: [PATCH] Use classList, make !k.WeEabo0o happy. --- 4chan_x.user.js | 6 +++--- script.coffee | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 8b6a95641..dd3e4d5d0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -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); diff --git a/script.coffee b/script.coffee index 8a01d658f..40804e679 100644 --- a/script.coffee +++ b/script.coffee @@ -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