.get(..) can now get elements by id...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2023-10-23 19:09:29 +03:00
parent 9ecbf4e060
commit 857c1ae9a7

View File

@ -693,7 +693,11 @@ var Outline = {
return path },
//
// .get([<offset>])
// .get(<index>)[, <offset>]
// .get(<path>[, <offset>])
// .get(<id>[, <offset>)
// -> <node>
//
// .get('focused'[, <offset>])
// -> <node>
//
@ -736,6 +740,10 @@ var Outline = {
: offset
var outline = this.outline
// id...
if(typeof(node) == 'string' && node[0] == '#'){
node = outline.querySelector(node) }
// root nodes...
if(node == 'top'){
return [...outline.children] }