add 'contains' for the classList implementation
This commit is contained in:
parent
080a5c16ea
commit
6553bd6c0c
@ -361,12 +361,16 @@ if (typeof PDFJS === 'undefined') {
|
|||||||
if (index >= 0 && remove)
|
if (index >= 0 && remove)
|
||||||
list.splice(index, 1);
|
list.splice(index, 1);
|
||||||
element.className = list.join(' ');
|
element.className = list.join(' ');
|
||||||
|
return (index >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
var classListPrototype = {
|
var classListPrototype = {
|
||||||
add: function(name) {
|
add: function(name) {
|
||||||
changeList(this.element, name, true, false);
|
changeList(this.element, name, true, false);
|
||||||
},
|
},
|
||||||
|
contains: function(name) {
|
||||||
|
return changeList(this.element, name, false, false);
|
||||||
|
},
|
||||||
remove: function(name) {
|
remove: function(name) {
|
||||||
changeList(this.element, name, false, true);
|
changeList(this.element, name, false, true);
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user