From ec6563f585effe60647e1f39b1904686fb5fd0c1 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 17 Jul 2015 11:44:26 -0400 Subject: [PATCH] Fixed JavaScript "dot-notation" violations. --- .eslintrc | 2 +- django/contrib/gis/static/gis/js/OLMapWidget.js | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.eslintrc b/.eslintrc index 50342abeb9..70a401366b 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,7 +2,7 @@ "rules": { "camelcase": [1, {"properties": "always"}], "comma-spacing": [2, {"before": false, "after": true}], - "dot-notation": [1, {"allowKeywords": true}], + "dot-notation": [2, {"allowKeywords": true}], "curly": [2, "all"], "indent": [ 2, diff --git a/django/contrib/gis/static/gis/js/OLMapWidget.js b/django/contrib/gis/static/gis/js/OLMapWidget.js index 40ff139996..01b57a7443 100644 --- a/django/contrib/gis/static/gis/js/OLMapWidget.js +++ b/django/contrib/gis/static/gis/js/OLMapWidget.js @@ -169,12 +169,12 @@ this.wkt_f = new OpenLayers.Format.DjangoWKT(); // Mapping from OGRGeomType name to OpenLayers.Geometry name - if (options['geom_name'] === 'Unknown') { - options['geom_type'] = OpenLayers.Geometry; - } else if (options['geom_name'] === 'GeometryCollection') { - options['geom_type'] = OpenLayers.Geometry.Collection; + if (options.geom_name === 'Unknown') { + options.geom_type = OpenLayers.Geometry; + } else if (options.geom_name === 'GeometryCollection') { + options.geom_type = OpenLayers.Geometry.Collection; } else { - options['geom_type'] = eval('OpenLayers.Geometry.' + options['geom_name']); + options.geom_type = eval('OpenLayers.Geometry.' + options.geom_name); } // Default options @@ -183,7 +183,7 @@ default_lat: 0, default_lon: 0, default_zoom: 4, - is_collection: new options['geom_type']() instanceof OpenLayers.Geometry.Collection, + is_collection: new options.geom_type() instanceof OpenLayers.Geometry.Collection, layerswitcher: false, map_options: {}, map_srid: 4326, @@ -210,9 +210,9 @@ 'strokeColor': '#' + this.options.color }; if (this.options.geom_name === 'LineString') { - defaults_style['strokeWidth'] = 3; + defaults_style.strokeWidth = 3; } - var styleMap = new OpenLayers.StyleMap({'default': OpenLayers.Util.applyDefaults(defaults_style, OpenLayers.Feature.Vector.style['default'])}); + var styleMap = new OpenLayers.StyleMap({'default': OpenLayers.Util.applyDefaults(defaults_style, OpenLayers.Feature.Vector.style.default)}); this.layers.vector = new OpenLayers.Layer.Vector(" " + this.options.name, {styleMap: styleMap}); this.map.addLayer(this.layers.vector); var wkt = document.getElementById(this.options.id).value;