From 93a6d4524f7101fa0f97148adf379a28f4545444 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Wed, 17 Jul 2013 14:55:28 +0200 Subject: [PATCH 1/1] Setting caret after removing list completely --- modules/documentCanvas/commands.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/documentCanvas/commands.js b/modules/documentCanvas/commands.js index b0fb093..0e48de1 100644 --- a/modules/documentCanvas/commands.js +++ b/modules/documentCanvas/commands.js @@ -55,15 +55,15 @@ commands.register('toggle-list', function(canvas, params) { parent1 = selectionStart.element.parent() || undefined, parent2 = selectionEnd.element.parent() || undefined; + var selectionFocus = cursor.getSelectionFocus(); if(params.toggle) { - var selectionFocus = cursor.getSelectionFocus(); canvas.list.create({element1: parent1, element2: parent2}); - canvas.setCurrentElement(selectionFocus.element, {caretTo: selectionFocus.offset}); } else { if(canvas.list.areItemsOfTheSameList({element1: parent1, element2: parent2})) { canvas.list.extractItems({element1: parent1, element2: parent2, merge: false}); } } + canvas.setCurrentElement(selectionFocus.element, {caretTo: selectionFocus.offset}); }); commands.register('toggle-grid', function(canvas, params) { -- 2.20.1