From ce51fb7e5de8910382af08e299831714e5f0e4e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 17 Apr 2013 16:48:17 +0200 Subject: [PATCH 1/1] Visual editor: edit pane reacts to node selecting --- modules/visualEditor.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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'); -- 2.20.1