Merge pull request #3888 from coolwanglu/master

Add 'contains' for the classList implementation
This commit is contained in:
Yury Delendik 2013-11-08 10:52:07 -08:00
commit 49dc1ccbe9

View File

@ -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);
}, },