From: Aleksander Ɓukasz Date: Mon, 6 May 2013 20:23:18 +0000 (+0200) Subject: Visual editor - throwing away "[[no class]]" marker X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/762797788fd3c0256a14b0f343410f40d34d4d8e Visual editor - throwing away "[[no class]]" marker --- diff --git a/modules/visualEditor.js b/modules/visualEditor.js index 1c61ef0..cef7de7 100644 --- a/modules/visualEditor.js +++ b/modules/visualEditor.js @@ -315,16 +315,18 @@ rng.modules.visualEditor = function(sandbox) { }, updateEditPane: function(node) { var pane = this.node.find('#rng-visualEditor-edit'); + var parentClass = node.parent().attr('wlxml-class'); pane.html( $(sandbox.getTemplate('editPane')({tag: node.attr('wlxml-tag'), klass: node.attr('wlxml-class')}))); var parent = node.parent('[wlxml-tag]').length ? { - repr: node.parent().attr('wlxml-tag') + ' / ' + (node.parent().attr('wlxml-class') || '[[no class]]'), + repr: node.parent().attr('wlxml-tag') + (parentClass ? ' / ' + parentClass : ''), id: node.parent().attr('id') } : undefined; var children = []; node.children('[wlxml-tag]').each(function() { var child = $(this); - children.push({repr: child.attr('wlxml-tag') + ' / ' + (child.attr('wlxml-class') || '[[no class]]'), id: child.attr('id')}); + var childClass = child.attr('wlxml-class'); + children.push({repr: child.attr('wlxml-tag') + (childClass ? ' / ' + childClass : ''), id: child.attr('id')}); }); var naviTemplate = sandbox.getTemplate('editPaneNavigation')({parent: parent, children: children}); pane.find('.rng-visualEditor-editPaneSurrouding > div').html($(naviTemplate));