From 0e5d188cad06b984b0d5f790b4d4ea9cd99c2a9c Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 23 Oct 2023 14:51:27 +0300 Subject: [PATCH] pgup/pgdown now move focus... (some tuning might still be needed) Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 26 ++++++++++++++++++-------- experiments/outline-editor/index.html | 2 +- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 9caace1..48afc40 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1462,19 +1462,29 @@ var Outline = { evt.preventDefault() this.focus(-1) }, PageUp: function(evt){ + var that = this var edited = this.get('edited') - if(!edited - && (evt.shiftKey - || evt.ctrlKey)){ + if(edited){ + return } + if(evt.shiftKey + || evt.ctrlKey){ evt.preventDefault() - this.shift('up') } }, + this.shift('up') + } else { + that.focus( + that.get('viewport')[0], 'prev') } }, PageDown: function(evt){ + var that = this var edited = this.get('edited') - if(!edited - && (evt.shiftKey - || evt.ctrlKey)){ + if(edited){ + return } + if(evt.shiftKey + || evt.ctrlKey){ evt.preventDefault() - this.shift('down') } }, + this.shift('down') + } else { + that.focus( + that.get('viewport').at(-1), 'next') } }, // indent.. Tab: function(evt){ diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 1ac0821..6c302e2 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -50,7 +50,6 @@ var setup = function(){ - - ## ToDo: - crop: show crop path (and depth) - - pgup/pgdown/~home/end~ buttons - identify a block: - DONE index (flat) - DONE path (index) @@ -118,6 +117,7 @@ var setup = function(){ block text - NOTE: this is only a problem if making list-items manually -- disable??? - empty item height is a bit off... + - DONE pgup/pgdown/home/end buttons - DONE FEATURE: "crop" -- view block tree separately... - DONE unify attr parsing collapsed:: true