mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
add 'contains' for the classList implementation
This commit is contained in:
parent
080a5c16ea
commit
6553bd6c0c
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue