diff --git a/experiments/outline-editor/editor.js b/experiments/outline-editor/editor.js index d5c3c5b..fafccc6 100755 --- a/experiments/outline-editor/editor.js +++ b/experiments/outline-editor/editor.js @@ -1518,12 +1518,25 @@ var Outline = { place = place == 'prev' ? 'before' : place + // ... ... + // cur cur + // new new <- before the next after cur + // --- --- + // ... ... ;(place == 'next' - && (cur.querySelector('.block') - || cur !== this.get(-1))) ? + // has children (uncollapsed)... + && (cur.querySelector('.block')?.offsetParent + // not last sibling... + || cur !== this.get('siblings').at(-1))) ? this.get(place).before(block) + // ... + // --- + // cur + // new <- next after cur + // ... : (place == 'next' - && cur === this.get(-1)) ? + // last sibling... + && cur === this.get('siblings').at(-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 a29a312..750b7e3 100755 --- a/experiments/outline-editor/index.html +++ b/experiments/outline-editor/index.html @@ -48,10 +48,6 @@ var setup = function(){ - - ## Bugs: focused:: true - - BUG: adding a new node after a last node on a level adds it to wrong level - - demo: - - a - - add node after this - BUG: mobile browsers behave quite chaotically ignoring parts of the styling... - - ## ToDo: