Browse Source

add 'contains' for the classList implementation

Lu Wang 12 years ago
parent
commit
6553bd6c0c
  1. 4
      web/compatibility.js

4
web/compatibility.js

@ -361,12 +361,16 @@ if (typeof PDFJS === 'undefined') { @@ -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…
Cancel
Save