experimentiong with selection...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-27 14:47:56 +03:00
parent 99f1de520f
commit 4796ba6753
2 changed files with 24 additions and 2 deletions

View File

@ -259,8 +259,9 @@ editor .outline .block:focus {
content: "●"; content: "●";
} }
/* select... */
/* XXX are we selecting subtrees or blocks??? */ /* XXX are we selecting subtrees or blocks??? */
.editor .outline [selected] { .editor .outline [selected]>.text {
background: silver; background: silver;
} }

View File

@ -1645,7 +1645,6 @@ var Outline = {
} else { } else {
evt.preventDefault() evt.preventDefault()
this.focus('focused', 1) } }, this.focus('focused', 1) } },
// horizontal navigation / collapse... // horizontal navigation / collapse...
ArrowLeft: function(evt){ ArrowLeft: function(evt){
var edited = this.get('edited') var edited = this.get('edited')
@ -1862,6 +1861,28 @@ var Outline = {
evt.preventDefault() evt.preventDefault()
tasks.toggleDone(this) }, tasks.toggleDone(this) },
// selection...
// XXX need more work...
// - should we select the .block or .text???
// - we should remember the first state and apply it (a-la FAR)
// and not simply toggle on/off per node...
s_ArrowUp: function(evt){
if(this.get('edited')){
return }
var elem = this.get()
elem.hasAttribute('selected') ?
elem.removeAttribute('selected')
: elem.setAttribute('selected', '')
this.keyboard.ArrowUp.call(this, evt) },
s_ArrowDown: function(evt){
if(this.get('edited')){
return }
var elem = this.get()
elem.hasAttribute('selected') ?
elem.removeAttribute('selected')
: elem.setAttribute('selected', '')
this.keyboard.ArrowDown.call(this, evt) },
// toggle checkbox... // toggle checkbox...
' ': function(evt){ ' ': function(evt){
if(this.get('edited') != null){ if(this.get('edited') != null){