From 5c28b8d10ea19bf9a37788da2aa11472fcd560bc Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 23 Oct 2023 15:34:24 +0300 Subject: [PATCH] tweak... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 48afc40..a2b8922 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1471,8 +1471,11 @@ var Outline = { evt.preventDefault() this.shift('up') } else { - that.focus( - that.get('viewport')[0], 'prev') } }, + var viewport = that.get('viewport') + viewport[0] === that.get(0) ? + that.focus(0) + : that.focus( + viewport[0], 'prev') } }, PageDown: function(evt){ var that = this var edited = this.get('edited') @@ -1483,8 +1486,11 @@ var Outline = { evt.preventDefault() this.shift('down') } else { - that.focus( - that.get('viewport').at(-1), 'next') } }, + var viewport = that.get('viewport') + viewport.at(-1) === that.get(-1) ? + that.focus(-1) + : that.focus( + that.get('viewport').at(-1), 'next') } }, // indent.. Tab: function(evt){