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
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user