From bec7881979149425a9c1b894f4741413b28c8141 Mon Sep 17 00:00:00 2001 From: Saivan Date: Tue, 27 Feb 2018 00:48:11 +1100 Subject: The first half of the library complies with Standard linting This commit reformats the code so that it complies with the standard linting style. Its currently a work in progress, but it is meant to pave the way for linting in the build process --- src/HtmlNode.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/HtmlNode.js') diff --git a/src/HtmlNode.js b/src/HtmlNode.js index 38309e3..37a231c 100644 --- a/src/HtmlNode.js +++ b/src/HtmlNode.js @@ -1,25 +1,24 @@ SVG.HtmlNode = SVG.invent({ - create: function(element) { + create: function (element) { this.node = element - } + }, -, extend: { - add: function(element, i) { + extend: { + add: function (element, i) { element = createElement(element) - if(element instanceof SVG.Nested) { + if (element instanceof SVG.Nested) { element = new SVG.Doc(element.node) element.setData(JSON.parse(element.node.getAttribute('svgjs:data')) || {}) } - if (i == null) - this.node.appendChild(element.node) - else if (element.node != this.node.children[i]) + if (i === null) { this.node.appendChild(element.node) } else if (element.node !== this.node.children[i]) { this.node.insertBefore(element.node, this.node.children[i]) + } return this - } + }, - , put: function(element, i) { + put: function (element, i) { this.add(element, i) return element } -- cgit v1.2.3