add 'contains' for the classList implementation

This commit is contained in:
Lu Wang 2013-11-06 14:52:04 +08:00
parent 080a5c16ea
commit 6553bd6c0c

View File

@ -361,12 +361,16 @@ if (typeof PDFJS === 'undefined') {
if (index >= 0 && remove)
list.splice(index, 1);
element.className = list.join(' ');
return (index >= 0);
}
var classListPrototype = {
add: function(name) {
changeList(this.element, name, true, false);
},
contains: function(name) {
return changeList(this.element, name, false, false);
},
remove: function(name) {
changeList(this.element, name, false, true);
},