diff --git a/experiments/outline-editor/editor.css b/experiments/outline-editor/editor.css index cb47f4a..8ff1e2e 100755 --- a/experiments/outline-editor/editor.css +++ b/experiments/outline-editor/editor.css @@ -74,6 +74,9 @@ outline: none; border: none; } +.editor.block-offsets .outline .block { + border-left: solid 1px silver; +} .editor .outline .block .block { margin-left: var(--item-indent); } diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 6e8d743..6dcb2e7 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -855,13 +855,19 @@ var Outline = { var elem = this.get(...arguments) ?? this.get(0) if(elem){ + var cur = this.get() + var blocks = this.get('visible') elem.focus({preventScroll: true}) ;(elem.classList.contains('code') ? elem : elem.querySelector('.code')) .scrollIntoView({ block: 'nearest', - //behavior: 'smooth', + // smooth for long jumps and instant for short jumps... + behavior: (cur == null + || Math.abs(blocks.indexOf(cur) - blocks.indexOf(elem)) > 2) ? + 'smooth' + : 'instant' }) } return elem }, edit: function(node='focused', offset){ diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 6cf3247..9228e13 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -342,6 +342,7 @@ var setup = function(){
+