X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/1fe8bb015648709853a4e14584ab1b3059b9ba1d..1dcf69f7caa40430482c79f46c5478f84f6afc0a:/modules/visualEditor.js?ds=sidebyside diff --git a/modules/visualEditor.js b/modules/visualEditor.js index 7f7bc2e..a607d86 100644 --- a/modules/visualEditor.js +++ b/modules/visualEditor.js @@ -71,9 +71,6 @@ rng.modules.visualEditor = function(sandbox) { var observer = new MutationObserver(function(mutations) { mutations.forEach(function(mutation) { - if(mutation.addedNodes.length > 0) { - console.log(mutation.addedNodes); - } _.each(mutation.addedNodes, function(node) { node = $(node); node.parent().find('[wlxml-tag]').each(function() { @@ -259,12 +256,7 @@ rng.modules.visualEditor = function(sandbox) { mediator.getCurrentNode().attr('wlxml-'+attr, target.val()); isDirty = true; }); - - view.node.on('change', '.rng-visualEditor-editPaneSelectionForm select', function(e) { - var target = $(e.target); - mediator.wrapWithNodeRequest(target.val(), null); - }); - + view.node.on('click', '.rng-visualEditor-editPaneSurrouding a', function(e) { var target = $(e.target); mediator.nodeDimmedById(target.attr('data-id')); @@ -291,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);