Use classList API

This commit is contained in:
JC Brand 2017-04-06 23:21:52 +02:00
parent b41d978d00
commit d2eadbdce4
2 changed files with 7 additions and 7 deletions

View File

@ -115,15 +115,15 @@
});
_converse.rosterview.update(); // XXX: Will normally called as event handler
}
test_utils.waitUntil(function () {
return test_utils.waitUntil(function () {
if (_converse.rosterview.$roster.hasScrollBar()) {
return $filter.is(':visible');
} else {
return !$filter.is(':visible');
}
}).then(function () {
done();
});
}).then(function () {
done();
});
});
}));

View File

@ -166,12 +166,12 @@
},
renderClearButton: function () {
var $roster_filter = this.$('.roster-filter');
$roster_filter[this.tog($roster_filter.val())]('x');
var roster_filter = this.el.querySelector('.roster-filter');
roster_filter.classList[this.tog(roster_filter.value)]('x');
},
tog: function (v) {
return v?'addClass':'removeClass';
return v?'add':'remove';
},
toggleX: function (ev) {