From: Aleksander Ɓukasz Date: Mon, 1 Jul 2013 13:45:27 +0000 (+0200) Subject: linting X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/ff17619a4071364ea15383c696cb7e84b6c83089 linting --- diff --git a/modules/documentCanvas/canvasNode.js b/modules/documentCanvas/canvasNode.js index d9475cb..a57c10a 100644 --- a/modules/documentCanvas/canvasNode.js +++ b/modules/documentCanvas/canvasNode.js @@ -85,7 +85,7 @@ CanvasNode.prototype.isOfClass = function(klass) { CanvasNode.prototype.getMetaAttr = function(attr) { return this.dom.attr('wlxml-meta-'+attr); -} +}; CanvasNode.prototype.getMetaAttrs = function() { var toret = []; @@ -99,11 +99,11 @@ CanvasNode.prototype.getMetaAttrs = function() { } } return toret; -} +}; CanvasNode.prototype.setMetaAttr = function(attr, value) { this.dom.attr('wlxml-meta-'+attr, value); -} +}; return { create: function(desc) { diff --git a/modules/documentCanvas/documentCanvas.js b/modules/documentCanvas/documentCanvas.js index c47b8bb..50a3777 100644 --- a/modules/documentCanvas/documentCanvas.js +++ b/modules/documentCanvas/documentCanvas.js @@ -36,6 +36,7 @@ return function(sandbox) { manager.currentNode.setMetaAttr(attr, value); } sandbox.publish('contentChanged'); + sandbox.publish('currentNodeChanged', manager.currentNode); } }, highlightNode: function(canvasNode) { diff --git a/modules/documentCanvas/tests/canvasNode.test.js b/modules/documentCanvas/tests/canvasNode.test.js index 5dccf7b..f944d90 100644 --- a/modules/documentCanvas/tests/canvasNode.test.js +++ b/modules/documentCanvas/tests/canvasNode.test.js @@ -78,7 +78,7 @@ suite('meta attributes', function() { var node = canvasNode.create({tag: 'tag', meta: {a:'1'}}); node.setMetaAttr('a', '2'); assert.equal(node.dom.attr('wlxml-meta-a'), '2'); - }) -}) + }); +}); }); \ No newline at end of file diff --git a/modules/nodePane/metaWidget/metaWidget.js b/modules/nodePane/metaWidget/metaWidget.js index 569153d..c1d7c94 100644 --- a/modules/nodePane/metaWidget/metaWidget.js +++ b/modules/nodePane/metaWidget/metaWidget.js @@ -9,13 +9,13 @@ define([ var templates = { string: _.template(stringFieldTpl) -} +}; var getAttrElement = function(attr) { var toret = $('
'); toret.append(templates.string({name: attr.name, value: attr.value})); return toret; -} +}; var MetaWidget = Backbone.View.extend({ events: { @@ -25,7 +25,7 @@ var MetaWidget = Backbone.View.extend({ var view = this; this.options.attrs.forEach(function(attr) { view.$el.append(getAttrElement(attr)); - }) + }); }, onMetaFieldChange: function(e) { var target = $(e.target); @@ -38,6 +38,6 @@ return { create: function(options) { return new MetaWidget(options); } -} +}; }); \ No newline at end of file