and some more whitespace fixes

This commit is contained in:
Vladimir Agafonkin 2012-11-07 19:14:25 +02:00
parent 2b225cc3a8
commit ed0686996a
7 changed files with 54 additions and 54 deletions

View File

@ -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);
},

View File

@ -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];

View File

@ -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;

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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;
},