X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/d1effc78cd6e71573f29f7901c598cabc3c2aaf8..9e4ef8a51fbe1e5df22334bc63276f9ffbaade73:/src/editor/modules/documentCanvas/commands.js diff --git a/src/editor/modules/documentCanvas/commands.js b/src/editor/modules/documentCanvas/commands.js index 8ceba63..284c613 100644 --- a/src/editor/modules/documentCanvas/commands.js +++ b/src/editor/modules/documentCanvas/commands.js @@ -191,11 +191,18 @@ commands.register('newNodeRequested', function(canvas, params, user) { } } else if(canvas.getCurrentNodeElement()) { wlxmlNode = canvas.getCurrentNodeElement().data('wlxmlNode'); - wrapper = insertNode(function() { - return wlxmlNode.wrapWith({tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}}); - }); + if(params.ctrlKey) { + wrapper = insertNode(function() { + return wlxmlNode.wrapWith({tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}}); + }); + } else { + wrapper = insertNode(function() { + var node = wlxmlNode.after({tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}}); + node.append({text:''}); + return node; + }); + } canvas.setCurrentElement(utils.findCanvasElement(wrapper)); - }