editor: canvas - block merging at the boundries of a context root
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 8 Aug 2014 09:31:15 +0000 (11:31 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 14 Aug 2014 14:26:15 +0000 (16:26 +0200)
src/editor/modules/documentCanvas/canvas/keyboard.js

index d8052ed..e43ea89 100644 (file)
@@ -257,6 +257,14 @@ var keyEventHandlers = [
                 return;
             }
 
+
+            var parent = element.wlxmlNode.parent();
+            if(element.wlxmlNode.getIndex() === 0 && parent.isContextRoot() && (!parent.is('item') || parent.getIndex() === 0)) {
+                // Don't even try to do anything at the edge of a context root, except for non-first items
+                // - this is a temporary solution until key events handling get refactored into something more sane.
+                return;
+            }
+
             e.preventDefault();
 
             s.canvas.wlxmlDocument.transaction(function() {