[OpenLayers-Commits] r2040 - trunk/openlayers/lib/OpenLayers/Marker

commits at openlayers.org commits at openlayers.org
Wed Dec 13 08:22:49 EST 2006


Author: euzuro
Date: 2006-12-13 08:22:47 -0500 (Wed, 13 Dec 2006)
New Revision: 2040

Modified:
   trunk/openlayers/lib/OpenLayers/Marker/Box.js
Log:
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

Modified: trunk/openlayers/lib/OpenLayers/Marker/Box.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Marker/Box.js	2006-12-13 13:15:29 UTC (rev 2039)
+++ trunk/openlayers/lib/OpenLayers/Marker/Box.js	2006-12-13 13:22:47 UTC (rev 2040)
@@ -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 @@
      * @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;
     },
     



More information about the Commits mailing list