From ed0686996a3754bb25ea410fbb15e17501547437 Mon Sep 17 00:00:00 2001 From: Vladimir Agafonkin Date: Wed, 7 Nov 2012 19:14:25 +0200 Subject: [PATCH] and some more whitespace fixes --- src/control/Control.Attribution.js | 8 +++--- src/control/Control.Layers.js | 18 ++++++------- src/control/Control.Scale.js | 4 +-- src/control/Control.Zoom.js | 10 +++---- src/control/Control.js | 4 +-- src/core/Browser.js | 42 +++++++++++++++--------------- src/core/Events.js | 22 ++++++++-------- 7 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/control/Control.Attribution.js b/src/control/Control.Attribution.js index aed0682d..664fb16e 100644 --- a/src/control/Control.Attribution.js +++ b/src/control/Control.Attribution.js @@ -15,8 +15,8 @@ L.Control.Attribution = L.Control.extend({ L.DomEvent.disableClickPropagation(this._container); map - .on('layeradd', this._onLayerAdd, this) - .on('layerremove', this._onLayerRemove, this); + .on('layeradd', this._onLayerAdd, this) + .on('layerremove', this._onLayerRemove, this); this._update(); @@ -25,8 +25,8 @@ L.Control.Attribution = L.Control.extend({ onRemove: function (map) { map - .off('layeradd', this._onLayerAdd) - .off('layerremove', this._onLayerRemove); + .off('layeradd', this._onLayerAdd) + .off('layerremove', this._onLayerRemove); }, diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index 0d87878e..49923b1b 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -64,8 +64,8 @@ L.Control.Layers = L.Control.extend({ if (this.options.collapsed) { L.DomEvent - .on(container, 'mouseover', this._expand, this) - .on(container, 'mouseout', this._collapse, this); + .on(container, 'mouseover', this._expand, this) + .on(container, 'mouseout', this._collapse, this); var link = this._layersLink = L.DomUtil.create('a', className + '-toggle', container); link.href = '#'; @@ -73,9 +73,9 @@ L.Control.Layers = L.Control.extend({ if (L.Browser.touch) { L.DomEvent - .on(link, 'click', L.DomEvent.stopPropagation) - .on(link, 'click', L.DomEvent.preventDefault) - .on(link, 'click', this._expand, this); + .on(link, 'click', L.DomEvent.stopPropagation) + .on(link, 'click', L.DomEvent.preventDefault) + .on(link, 'click', this._expand, this); } else { L.DomEvent.on(link, 'focus', this._expand, this); @@ -118,7 +118,7 @@ L.Control.Layers = L.Control.extend({ this._overlaysList.innerHTML = ''; var baseLayersPresent = false, - overlaysPresent = false; + overlaysPresent = false; for (var i in this._layers) { if (this._layers.hasOwnProperty(i)) { @@ -177,9 +177,9 @@ L.Control.Layers = L.Control.extend({ _onInputClick: function () { var i, input, obj, - inputs = this._form.getElementsByTagName('input'), - inputsLen = inputs.length, - baseLayer; + inputs = this._form.getElementsByTagName('input'), + inputsLen = inputs.length, + baseLayer; for (i = 0; i < inputsLen; i++) { input = inputs[i]; diff --git a/src/control/Control.Scale.js b/src/control/Control.Scale.js index 036031ce..6f911c34 100644 --- a/src/control/Control.Scale.js +++ b/src/control/Control.Scale.js @@ -71,8 +71,8 @@ L.Control.Scale = L.Control.extend({ _updateImperial: function (maxMeters) { var maxFeet = maxMeters * 3.2808399, - scale = this._iScale, - maxMiles, miles, feet; + scale = this._iScale, + maxMiles, miles, feet; if (maxFeet > 5280) { maxMiles = maxFeet / 5280; diff --git a/src/control/Control.Zoom.js b/src/control/Control.Zoom.js index 09f6faaa..fe6821b8 100644 --- a/src/control/Control.Zoom.js +++ b/src/control/Control.Zoom.js @@ -29,11 +29,11 @@ L.Control.Zoom = L.Control.extend({ link.title = title; L.DomEvent - .on(link, 'click', L.DomEvent.stopPropagation) - .on(link, 'mousedown', L.DomEvent.stopPropagation) - .on(link, 'dblclick', L.DomEvent.stopPropagation) - .on(link, 'click', L.DomEvent.preventDefault) - .on(link, 'click', fn, context); + .on(link, 'click', L.DomEvent.stopPropagation) + .on(link, 'mousedown', L.DomEvent.stopPropagation) + .on(link, 'dblclick', L.DomEvent.stopPropagation) + .on(link, 'click', L.DomEvent.preventDefault) + .on(link, 'click', fn, context); return link; } diff --git a/src/control/Control.js b/src/control/Control.js index f576ebb4..6dc90d2b 100644 --- a/src/control/Control.js +++ b/src/control/Control.js @@ -33,7 +33,7 @@ L.Control = L.Class.extend({ var container = this._container = this.onAdd(map), pos = this.getPosition(), - corner = map._controlCorners[pos]; + corner = map._controlCorners[pos]; L.DomUtil.addClass(container, 'leaflet-control'); @@ -48,7 +48,7 @@ L.Control = L.Class.extend({ removeFrom: function (map) { var pos = this.getPosition(), - corner = map._controlCorners[pos]; + corner = map._controlCorners[pos]; corner.removeChild(this._container); this._map = null; diff --git a/src/core/Browser.js b/src/core/Browser.js index 800a4ebe..222b6d30 100644 --- a/src/core/Browser.js +++ b/src/core/Browser.js @@ -1,30 +1,30 @@ (function () { var ie = !!window.ActiveXObject, - // http://tanalin.com/en/articles/ie-version-js/ - ie6 = ie && !window.XMLHttpRequest, - ie7 = ie && !document.querySelector, + // http://tanalin.com/en/articles/ie-version-js/ + ie6 = ie && !window.XMLHttpRequest, + ie7 = ie && !document.querySelector, - // terrible browser detection to work around Safari / iOS / Android browser bugs - // see TileLayer._addTile and debug/hacks/jitter.html + // terrible browser detection to work around Safari / iOS / Android browser bugs + // see TileLayer._addTile and debug/hacks/jitter.html - ua = navigator.userAgent.toLowerCase(), - webkit = ua.indexOf("webkit") !== -1, - chrome = ua.indexOf("chrome") !== -1, - android = ua.indexOf("android") !== -1, - android23 = ua.search("android [23]") !== -1, + ua = navigator.userAgent.toLowerCase(), + webkit = ua.indexOf("webkit") !== -1, + chrome = ua.indexOf("chrome") !== -1, + android = ua.indexOf("android") !== -1, + android23 = ua.search("android [23]") !== -1, - mobile = typeof orientation !== undefined + '', - msTouch = (window.navigator && window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints), - retina = (('devicePixelRatio' in window && window.devicePixelRatio > 1) || - ('matchMedia' in window && window.matchMedia("(min-resolution:144dpi)").matches)), + mobile = typeof orientation !== undefined + '', + msTouch = (window.navigator && window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints), + retina = (('devicePixelRatio' in window && window.devicePixelRatio > 1) || + ('matchMedia' in window && window.matchMedia("(min-resolution:144dpi)").matches)), - doc = document.documentElement, - ie3d = ie && ('transition' in doc.style), - webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()), - gecko3d = 'MozPerspective' in doc.style, - opera3d = 'OTransition' in doc.style, - any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d || opera3d); + doc = document.documentElement, + ie3d = ie && ('transition' in doc.style), + webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()), + gecko3d = 'MozPerspective' in doc.style, + opera3d = 'OTransition' in doc.style, + any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d || opera3d); var touch = !window.L_NO_TOUCH && (function () { @@ -38,7 +38,7 @@ // Firefox/Gecko var div = document.createElement('div'), - supported = false; + supported = false; if (!div.setAttribute) { return false; diff --git a/src/core/Events.js b/src/core/Events.js index ee17f517..57e775f4 100644 --- a/src/core/Events.js +++ b/src/core/Events.js @@ -7,11 +7,11 @@ var key = '_leaflet_events'; L.Mixin = {}; L.Mixin.Events = { - + addEventListener: function (types, fn, context) { // (String, Function[, Object]) or (Object[, Object]) var events = this[key] = this[key] || {}, type, i, len; - + // Types can be a map of types/handlers if (typeof types === 'object') { for (type in types) { @@ -19,12 +19,12 @@ L.Mixin.Events = { this.addEventListener(type, types[type], fn); } } - + return this; } - + types = L.Util.splitWords(types); - + for (i = 0, len = types.length; i < len; i++) { events[types[i]] = events[types[i]] || []; events[types[i]].push({ @@ -32,7 +32,7 @@ L.Mixin.Events = { context: context || this }); } - + return this; }, @@ -43,24 +43,24 @@ L.Mixin.Events = { removeEventListener: function (types, fn, context) { // (String[, Function, Object]) or (Object[, Object]) var events = this[key], type, i, len, listeners, j; - + if (typeof types === 'object') { for (type in types) { if (types.hasOwnProperty(type)) { this.removeEventListener(type, types[type], fn); } } - + return this; } - + types = L.Util.splitWords(types); for (i = 0, len = types.length; i < len; i++) { if (this.hasEventListeners(types[i])) { listeners = events[types[i]]; - + for (j = listeners.length - 1; j >= 0; j--) { if ( (!fn || listeners[j].action === fn) && @@ -71,7 +71,7 @@ L.Mixin.Events = { } } } - + return this; },