X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/bf8e16e2a24ce9828193a3b4145dfdbc5b94a935..9692d9e3014b32a2e159ad6f95acb7fc387a83e2:/src/editor/modules/documentCanvas/commands.js diff --git a/src/editor/modules/documentCanvas/commands.js b/src/editor/modules/documentCanvas/commands.js index a411a37..8a26ecc 100644 --- a/src/editor/modules/documentCanvas/commands.js +++ b/src/editor/modules/documentCanvas/commands.js @@ -94,8 +94,13 @@ commands.register('list', function(canvas, params) { node2 = parent2.wlxmlNode, doc = node1.document; - doc.createList({node1: node1, node2: node2}); - canvas.setCurrentElement(selectionFocus.element, {caretTo: selectionFocus.offset}); + doc.transaction(function() { + doc.createList({node1: node1, node2: node2, klass: params.meta === 'num' ? 'list.enum' : 'list'}); + }, { + success: function() { + canvas.setCurrentElement(selectionFocus.element, {caretTo: selectionFocus.offset}); + } + }); }); commands.register('toggle-grid', function(canvas, params) {