From: Aleksander Ɓukasz Date: Sun, 30 Jun 2013 21:44:39 +0000 (+0200) Subject: Some code improvements suggested by linter X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/969f365b3ee6d3cb54f98b23e1ebb97df9f801dd?ds=inline;hp=4a10da821d96b8e462cc9db5e74e2507445eee76 Some code improvements suggested by linter --- diff --git a/modules/data/data.js b/modules/data/data.js index 51a4398..8bd553c 100644 --- a/modules/data/data.js +++ b/modules/data/data.js @@ -30,7 +30,7 @@ return function(sandbox) { for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); - if (c.indexOf(nameEQ) == 0) return unescape(c.substring(nameEQ.length, c.length)); + if (c.indexOf(nameEQ) === 0) return unescape(c.substring(nameEQ.length, c.length)); } return null; } diff --git a/modules/documentCanvas/canvas.js b/modules/documentCanvas/canvas.js index 94329a4..4a953d1 100644 --- a/modules/documentCanvas/canvas.js +++ b/modules/documentCanvas/canvas.js @@ -143,7 +143,7 @@ Canvas.prototype.nodeRemove = function(options) { Canvas.prototype.listCreate = function(options) { var element1 = $(this.content.find('#' + options.start.getId()).get(0)); var element2 = $(this.content.find('#' + options.end.getId()).get(0)); - if(!element1.parent().get(0) === element2.parent().get(0)) + if(element1.parent().get(0) !== element2.parent().get(0)) return false; var parent = element1.parent(); diff --git a/modules/nodeFamilyTree/nodeFamilyTree.js b/modules/nodeFamilyTree/nodeFamilyTree.js index 05d4aac..049352e 100644 --- a/modules/nodeFamilyTree/nodeFamilyTree.js +++ b/modules/nodeFamilyTree/nodeFamilyTree.js @@ -33,7 +33,7 @@ return function(sandbox) { var nodes = this.nodes = {}; this.currentNode = node; var parentNode = node.parent(); - var parent = undefined; + var parent; if(parentNode) { parent = { diff --git a/modules/rng/rng.js b/modules/rng/rng.js index 191c449..980e6ff 100644 --- a/modules/rng/rng.js +++ b/modules/rng/rng.js @@ -38,7 +38,7 @@ return function(sandbox) { dirty.sourceEditor = false; } if(slug === 'editor') { - var doc = dirty.documentCanvas ? sandbox.getModule('documentCanvas').getDocument() : sandbox.getModule('data').getDocument(); + doc = dirty.documentCanvas ? sandbox.getModule('documentCanvas').getDocument() : sandbox.getModule('data').getDocument(); if(dirty.metadataEditor) { doc = sandbox.getModule('metadataEditor').attachMetadata(doc); }