cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-09-29 15:38:17 +03:00
parent 94ef144c0f
commit 66c29d3f21
3 changed files with 11 additions and 12 deletions

View File

@ -57,5 +57,5 @@
} }
.editor div:focus>span, .editor div:focus>span,
.editor div:focus>textarea { .editor div:focus>textarea {
background: silver; background: rgba(0,0,0,0.1);
} }

View File

@ -31,8 +31,8 @@ var Outline = {
// config... // config...
// //
left_key_expands: false, left_key_collapses: true,
right_key_collapses: true, right_key_expands: true,
// XXX revise name... // XXX revise name...
@ -289,18 +289,17 @@ var Outline = {
if(this.dom.querySelector('.editor textarea:focus')){ if(this.dom.querySelector('.editor textarea:focus')){
// XXX if at end of element move to next... // XXX if at end of element move to next...
return } return }
if(this.left_key_expands){ ;((this.left_key_collapses
this.toggleCollapse(true) || evt.shiftKey)
this.get('parent')?.focus() && this.get().getAttribute('collapsed') == null
} else { && this.get('children').length > 0) ?
evt.shiftKey ? this.toggleCollapse(true)
this.toggleCollapse(true) : this.get('parent')?.focus() },
: this.get('parent')?.focus() } },
ArrowRight: function(evt){ ArrowRight: function(evt){
if(this.dom.querySelector('.editor textarea:focus')){ if(this.dom.querySelector('.editor textarea:focus')){
// XXX if at end of element move to next... // XXX if at end of element move to next...
return } return }
if(this.right_key_collapses){ if(this.right_key_expands){
this.toggleCollapse(false) this.toggleCollapse(false)
var child = this.get('children')[0] var child = this.get('children')[0]
child?.focus() child?.focus()

View File

@ -63,7 +63,7 @@ TODO:
- shifting nodes up/down - shifting nodes up/down
- multiple node selection - multiple node selection
- <s>serialize</s>/deserialize - <s>serialize</s>/deserialize
- add optional styling to nodes - <s>add optional text styling to nodes</s>
Controls: Controls:
up - focus node above up - focus node above