From 5be146deeae22b5fd129c9f2c413b166910ebd3e Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Mon, 3 Feb 2014 12:41:12 -0500 Subject: [PATCH] changed logic for hasClass function --- showup.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/showup.js b/showup.js index 39b7fde..16516ad 100644 --- a/showup.js +++ b/showup.js @@ -111,7 +111,9 @@ * @return-{boolean} */ var hasClass = function (className) { - return this.className.indexOf(className) > -1; + var regex = new RegExp('(^| )' + className + '($| )'); + + return regex.test(this.className); };