From c014e5ea723f4f815b3db5d13309e4f46f74073c Mon Sep 17 00:00:00 2001 From: euzuro Date: Wed, 13 Dec 2006 13:22:47 +0000 Subject: [PATCH] r2039 contained a small stylistic change that I thought was insignificant but upon further reflection is not. the '||' style is beautiful, but it breaks if a 0, '', or 'false' value is specified (as they all evaluate to false, and thus the default is taken). So if the user wants to specify a 0-width border, s/he cannot. This commit reverts to how it previously was, with the addition of {} as per OL coding standards. Also the addition of one small line break, also for coding standards git-svn-id: http://svn.openlayers.org/trunk/openlayers@2040 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Marker/Box.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Marker/Box.js b/lib/OpenLayers/Marker/Box.js index 300c192346..412c875cbd 100644 --- a/lib/OpenLayers/Marker/Box.js +++ b/lib/OpenLayers/Marker/Box.js @@ -9,7 +9,8 @@ * @requires OpenLayers/Marker.js */ OpenLayers.Marker.Box = OpenLayers.Class.create(); -OpenLayers.Marker.Box.prototype = OpenLayers.Class.inherit( OpenLayers.Marker, { +OpenLayers.Marker.Box.prototype = + OpenLayers.Class.inherit( OpenLayers.Marker, { /** @type OpenLayers.Bounds */ bounds: null, @@ -38,8 +39,12 @@ OpenLayers.Marker.Box.prototype = OpenLayers.Class.inherit( OpenLayers.Marker, { * @param {int} width Default is 2 */ setBorder: function (color, width) { - color = color || "red"; - width = width || 2; + if (!color) { + color = "red"; + } + if (!width) { + width = 2; + } this.div.style.border = width + "px solid " + color; },