From 24cf9694228af36084f9c4d7c45d65006e99613d Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Thu, 31 Jul 2014 21:47:23 +0200 Subject: [PATCH] Use strict equalities in web/ui_utils.js --- web/ui_utils.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/ui_utils.js b/web/ui_utils.js index 29ee01bb8..b38ec4bc3 100644 --- a/web/ui_utils.js +++ b/web/ui_utils.js @@ -30,7 +30,7 @@ var CustomStyle = (function CustomStyleClosure() { CustomStyle.getProp = function get(propName, element) { // check cache only when no element is given - if (arguments.length == 1 && typeof _cache[propName] == 'string') { + if (arguments.length === 1 && typeof _cache[propName] === 'string') { return _cache[propName]; } @@ -38,7 +38,7 @@ var CustomStyle = (function CustomStyleClosure() { var style = element.style, prefixed, uPropName; // test standard property first - if (typeof style[propName] == 'string') { + if (typeof style[propName] === 'string') { return (_cache[propName] = propName); } @@ -48,7 +48,7 @@ var CustomStyle = (function CustomStyleClosure() { // test vendor specific properties for (var i = 0, l = prefixes.length; i < l; i++) { prefixed = prefixes[i] + uPropName; - if (typeof style[prefixed] == 'string') { + if (typeof style[prefixed] === 'string') { return (_cache[propName] = prefixed); } } @@ -59,7 +59,7 @@ var CustomStyle = (function CustomStyleClosure() { CustomStyle.setProp = function set(propName, element, str) { var prop = this.getProp(propName); - if (prop != 'undefined') { + if (prop !== 'undefined') { element.style[prop] = str; } }; @@ -93,7 +93,7 @@ function getOutputScale(ctx) { return { sx: pixelRatio, sy: pixelRatio, - scaled: pixelRatio != 1 + scaled: pixelRatio !== 1 }; } @@ -161,7 +161,7 @@ function getPDFFileNameFromURL(url) { reFilename.exec(splitURI[3]); if (suggestedFilename) { suggestedFilename = suggestedFilename[0]; - if (suggestedFilename.indexOf('%') != -1) { + if (suggestedFilename.indexOf('%') !== -1) { // URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf try { suggestedFilename =