From: Aleksander Ɓukasz Date: Wed, 17 Apr 2013 14:48:17 +0000 (+0200) Subject: Visual editor: edit pane reacts to node selecting X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/ce51fb7e5de8910382af08e299831714e5f0e4e4 Visual editor: edit pane reacts to node selecting --- diff --git a/modules/visualEditor.js b/modules/visualEditor.js index d152acd..98923a5 100644 --- a/modules/visualEditor.js +++ b/modules/visualEditor.js @@ -89,6 +89,7 @@ rng.modules.visualEditor = function(sandbox) { _markSelected: function(node) { this.node.find('.rng-current').removeClass('rng-current'); node.addClass('rng-current'); + mediator.nodeSelected(node); }, _addMetaRow: function(key, value) { var newRow = $(sandbox.getTemplate('metaItem')({key: key || '', value: value || ''})); @@ -117,16 +118,26 @@ rng.modules.visualEditor = function(sandbox) { this.node.find('#rng-visualEditor-sidebarButtons li').removeClass('active'); this.node.find('#rng-visualEditor-sidebarButtons li a[data-content-id=' + id + ']').parent().addClass('active'); + }, + updateEditPane: function(node) { + var pane = this.node.find('#rng-visualEditor-edit'); + pane.html( $(sandbox.getTemplate('editPane')({tag: node.attr('wlxml-tag'), klass: node.attr('wlxml-class')}))); } - } view.setup(); sideBarView.setup(); + var mediator = { + nodeSelected: function(node) { + sideBarView.updateEditPane(node); + } + } + var isDirty = false; + return { start: function() { sandbox.publish('ready');