From 09469026c673ca87a26d415cded3a65bacf846fb Mon Sep 17 00:00:00 2001 From: Joshua Pan Date: Tue, 17 Apr 2018 23:53:14 -0700 Subject: [PATCH] zjquery: Allow removeClass() to remove multiple classes simultaneously. removeClass() now splits class_names by spaces to get multiple class names. Then removes each individual class name. --- frontend_tests/zjsunit/zjquery.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend_tests/zjsunit/zjquery.js b/frontend_tests/zjsunit/zjquery.js index 53bd1e4ba6..7a950dd98a 100644 --- a/frontend_tests/zjsunit/zjquery.js +++ b/frontend_tests/zjsunit/zjquery.js @@ -262,8 +262,11 @@ exports.make_new_elem = function (selector, opts) { attrs.del(name); return self; }, - removeClass: function (class_name) { - classes.del(class_name); + removeClass: function (class_names) { + class_names = class_names.split(' '); + class_names.forEach(function (class_name) { + classes.del(class_name); + }); return self; }, remove: function () {