Fix: Consider visible text elements only when searching for next available one
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Sun, 4 Aug 2013 21:28:22 +0000 (23:28 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 5 Aug 2013 10:20:07 +0000 (12:20 +0200)
modules/documentCanvas/canvas/canvas.js

index 45147d1..5f78277 100644 (file)
@@ -182,7 +182,7 @@ $.extend(Canvas.prototype, {
                             direction = 'below';
                             caretTo = 'start';
                         }
                             direction = 'below';
                             caretTo = 'start';
                         }
-                        element = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]', direction, window.getSelection().focusNode));
+                        element = canvas.getDocumentElement(utils.nearestInDocumentOrder('[document-text-element]:visible', direction, window.getSelection().focusNode));
                     }
                     canvas.setCurrentElement(element, {caretTo: caretTo});
                 }
                     }
                     canvas.setCurrentElement(element, {caretTo: caretTo});
                 }