From 35dea5e3a6e20a8d40377c0d5539d12ec8486629 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Sun, 23 Mar 2014 18:29:47 +0100 Subject: [PATCH] Always use === to compare with 0 --- src/ol/coordinate.js | 2 +- src/ol/map.js | 2 +- src/ol/mapbrowserevent.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/coordinate.js b/src/ol/coordinate.js index e027da504d..81838416aa 100644 --- a/src/ol/coordinate.js +++ b/src/ol/coordinate.js @@ -66,7 +66,7 @@ ol.coordinate.closestOnSegment = function(coordinate, segment) { var y2 = end[1]; var dx = x2 - x1; var dy = y2 - y1; - var along = (dx == 0 && dy == 0) ? 0 : + var along = (dx === 0 && dy === 0) ? 0 : ((dx * (x0 - x1)) + (dy * (y0 - y1))) / ((dx * dx + dy * dy) || 0); var x, y; if (along <= 0) { diff --git a/src/ol/map.js b/src/ol/map.js index fbe46a52cd..a2b90479a1 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -1265,7 +1265,7 @@ ol.Map.prototype.renderFrame_ = function(time) { Array.prototype.push.apply( this.postRenderFunctions_, frameState.postRenderFunctions); - var idle = this.preRenderFunctions_.length == 0 && + var idle = this.preRenderFunctions_.length === 0 && !frameState.animate && !frameState.viewHints[ol.ViewHint.ANIMATING] && !frameState.viewHints[ol.ViewHint.INTERACTING]; diff --git a/src/ol/mapbrowserevent.js b/src/ol/mapbrowserevent.js index f2b7bdcb99..b1bd271e83 100644 --- a/src/ol/mapbrowserevent.js +++ b/src/ol/mapbrowserevent.js @@ -323,7 +323,7 @@ ol.MapBrowserEventHandler.prototype.isMouseActionButton_ = if (ol.LEGACY_IE_SUPPORT && ol.IS_LEGACY_IE) { return pointerEvent.button == 1; } else { - return pointerEvent.button == 0; + return pointerEvent.button === 0; } };