From 8d4f4499817d89b50cb595c74112df4d22b37d93 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 27 Nov 2023 05:29:07 +0300 Subject: [PATCH] tweaks fixes and cleanup... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.js | 13 +++++++------ experiments/outline-editor/index.html | 5 +++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index 42af45b..d3d9f06 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1503,6 +1503,8 @@ var Outline = { /* XXX not used -- do we need this?? // XXX UPDATE_CODE_SIZE this is a no-op at this point -- do we need this??? _updateCodeSize: function(code, view){ + // XXX + return this code.style.height = getComputedStyle( view @@ -1691,12 +1693,9 @@ var Outline = { state = state == 'next' ? node.getAttribute('collapsed') != '' : state - if(state){ + state ? node.setAttribute('collapsed', '') - } else { - node.removeAttribute('collapsed') - for(var elem of [...node.querySelectorAll('textarea')]){ - elem.updateSize() } } + : node.removeAttribute('collapsed') this.__change__() return node }, show: function(node='focused', offset){ @@ -2584,7 +2583,9 @@ var Outline = { // give the browser a chance to update the DOM... // XXX revise... setTimeout(function(){ - that.runPlugins('__editedcode__', evt, that, elem) }, 0) } + that.runPlugins('__editedcode__', evt, that, elem) + // this will resize the text to fill the available area... + elem.style.removeProperty('height') }, 0) } that.runPlugins('__focusout__', evt, that, elem) }) // update .code... diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 86fd3b4..74d8120 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -48,6 +48,11 @@ var setup = function(){ - - ## Bugs: focused:: true + - BUG: cursor placement is off again... + - ``` + text text text + ``` + text text text (a click here is offset right by 4-5 chars) - BUG: styling error... - this _seems `to` work_ - `while` _this `does` not_