From 6553bd6c0c593d5f5b92f153a0501613e60f1304 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Wed, 6 Nov 2013 14:52:04 +0800 Subject: [PATCH] add 'contains' for the classList implementation --- web/compatibility.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/compatibility.js b/web/compatibility.js index 23ca69e25..8ca68137f 100644 --- a/web/compatibility.js +++ b/web/compatibility.js @@ -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); },