add indent eslint rule and fix some whitespace

This commit is contained in:
Vladimir Agafonkin 2015-03-01 12:01:28 +02:00
parent d7007ef353
commit 954ef1cc10
5 changed files with 13 additions and 12 deletions

View File

@ -10,6 +10,7 @@
"space-after-keywords": 2,
"no-lonely-if": 2,
"comma-style": 2,
"indent": [2, "tab"],
"no-underscore-dangle": 0,
"no-constant-condition": 0,
"no-multi-spaces": 0,

View File

@ -4,7 +4,7 @@
"description": "JavaScript library for mobile-friendly interactive maps",
"devDependencies": {
"copyfiles": "0.1.0",
"eslint": "^0.13.0",
"eslint": "^0.15.1",
"happen": "~0.1.3",
"jake": "~8.0.10",
"karma": "~0.12.31",

View File

@ -134,8 +134,8 @@ L.Evented = L.Class.extend({
events = this._events;
if (events) {
var typeIndex = events[type + '_idx'],
i, len, listeners, id;
var typeIndex = events[type + '_idx'],
i, len, listeners, id;
if (events[type]) {
// make sure adding/removing listeners inside other listeners won't cause infinite loop

View File

@ -114,7 +114,7 @@ L.Canvas = L.Renderer.extend({
len = parts.length,
ctx = this._ctx;
if (!len) { return; }
if (!len) { return; }
ctx.beginPath();

View File

@ -35,14 +35,14 @@ L.Map.Keyboard = L.Handler.extend({
}
L.DomEvent.on(container, {
focus: this._onFocus,
blur: this._onBlur,
mousedown: this._onMouseDown
focus: this._onFocus,
blur: this._onBlur,
mousedown: this._onMouseDown
}, this);
this._map.on({
focus: this._addHooks,
blur: this._removeHooks
blur: this._removeHooks
}, this);
},
@ -50,14 +50,14 @@ L.Map.Keyboard = L.Handler.extend({
this._removeHooks();
L.DomEvent.off(this._map._container, {
focus: this._onFocus,
blur: this._onBlur,
mousedown: this._onMouseDown
focus: this._onFocus,
blur: this._onBlur,
mousedown: this._onMouseDown
}, this);
this._map.off({
focus: this._addHooks,
blur: this._removeHooks
blur: this._removeHooks
}, this);
},