From: Aleksander Ɓukasz Date: Thu, 25 Apr 2013 19:20:00 +0000 (+0200) Subject: Visual editor - handling root wlxml element in navigation table X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/1dcf69f7caa40430482c79f46c5478f84f6afc0a Visual editor - handling root wlxml element in navigation table --- diff --git a/modules/visualEditor.js b/modules/visualEditor.js index dfa8335..a607d86 100644 --- a/modules/visualEditor.js +++ b/modules/visualEditor.js @@ -283,10 +283,10 @@ rng.modules.visualEditor = function(sandbox) { var pane = this.node.find('#rng-visualEditor-edit'); pane.html( $(sandbox.getTemplate('editPane')({tag: node.attr('wlxml-tag'), klass: node.attr('wlxml-class')}))); - var parent = { + var parent = node.parent('[wlxml-tag]').length ? { repr: node.parent().attr('wlxml-tag') + ' / ' + (node.parent().attr('wlxml-class') || '[[no class]]'), id: node.parent().attr('id') - } + } : undefined; var children = []; node.children('[wlxml-tag]').each(function() { var child = $(this);