From 9ecbf4e06074eec5ba0466d54b0fd17b983d59a8 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 23 Oct 2023 17:43:25 +0300 Subject: [PATCH] ... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 4 +++- experiments/outline-editor/generic.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 2fad816..25d4ceb 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1057,6 +1057,7 @@ var Outline = { var stack = this.__crop_stack ??= [] stack.push([this.json(), this.path()]) this.load(this.data()) + this.dom.classList.add('crop') return this }, // XXX use JSON API... uncrop: function(){ @@ -1064,7 +1065,8 @@ var Outline = { return this} var [state, path] = this.__crop_stack.pop() if(this.__crop_stack.length == 0){ - this.__crop_stack = undefined } + this.__crop_stack = undefined + this.dom.classList.remove('crop') } // update state... path .slice(0, -1) diff --git a/experiments/outline-editor/generic.js b/experiments/outline-editor/generic.js index 9fdcf9d..af23e08 100755 --- a/experiments/outline-editor/generic.js +++ b/experiments/outline-editor/generic.js @@ -76,6 +76,8 @@ HTMLTextAreaElement.prototype.getTextGeometry = function(){ span.append( text.slice(0, offset), carret, + // NOTE: wee need the rest of the text for the carret to be typeset + // to the correct line... text.slice(offset)) document.body.append(span)