From d21d233b07c3199d394aa9f398193cc4e1b947d5 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 25 Oct 2023 17:37:02 +0300 Subject: [PATCH] fixes... Signed-off-by: Alex A. Naanou --- experiments/outline-editor/editor.css | 5 ++++- experiments/outline-editor/editor.js | 6 ++++-- experiments/outline-editor/index.html | 2 -- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/experiments/outline-editor/editor.css b/experiments/outline-editor/editor.css index 616e886..dba4769 100755 --- a/experiments/outline-editor/editor.css +++ b/experiments/outline-editor/editor.css @@ -101,7 +101,8 @@ .editor.block-offsets .outline .block { border-left: solid 1px silver; } -.editor .outline .block .block { +.editor .outline .block .block, +.editor.crop .outline .block[cropped] .block[cropped] { margin-left: var(--item-indent); } .editor .outline .block>.text { @@ -264,6 +265,8 @@ editor .outline .block:focus { /* crop... */ +/* NOTE: also see rules for: .editor .outline .block .block +* ...can we avoid this?? (XXX) */ .editor.crop .outline .block:not([cropped]) { padding: 0; border: none; diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index c9adb38..c2f7100 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1399,6 +1399,8 @@ var Outline = { var block = document.createElement('div') block.classList.add('block') block.setAttribute('tabindex', '0') + // XXX hack?? + block.setAttribute('cropped', '') // code... var code = document.createElement('textarea') .autoUpdateSize() @@ -1422,10 +1424,10 @@ var Outline = { : place ;(place == 'next' && (cur.querySelector('.block') - || cur.nextElementSibling)) ? + || cur !== this.get(-1))) ? this.get(place).before(block) : (place == 'next' - && !cur.nextElementSibling) ? + && cur === this.get(-1)) ? cur.after(block) : (place == 'before' || place == 'after') ? cur[place](block) diff --git a/experiments/outline-editor/index.html b/experiments/outline-editor/index.html index 96997a0..ffaf296 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -48,8 +48,6 @@ var setup = function(){ - - ## Bugs: focused:: true - - BUG: crop: adding siblings to crop root instantly hides them - - _should add `.cropped` class... but where???_ - BUG: mobile browsers behave quite chaotically ignoring parts of the styling... - - ## ToDo: