X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/c0e11a8f6d0d9a4c030aa90fe91f0fc49cd05e0e..b8a6d80a6573772f180b39aaeaf6c3ef48f2c021:/modules/visualEditor.js?ds=sidebyside diff --git a/modules/visualEditor.js b/modules/visualEditor.js index f3c0a5c..702c812 100644 --- a/modules/visualEditor.js +++ b/modules/visualEditor.js @@ -31,6 +31,18 @@ rng.modules.visualEditor = function(sandbox) { view._markSelected(anchor); }); + this.node.on('keydown', '#rng-visualEditor-contentWrapper', function(e) { + if(e.which === 13) { + e.preventDefault(); + var anchor = $(window.getSelection().anchorNode); + if(anchor[0].nodeType === Node.TEXT_NODE) + anchor = anchor.parent(); + var newNode = anchor.clone().empty(); + anchor.after(newNode); + view.selectNode(newNode); + } + }); + var metaTable = this.metaTable = this.node.find('#rng-visualEditor-meta table');