mirror of
https://github.com/flynx/pWiki.git
synced 2025-10-29 18:10:09 +00:00
.get(..) can now get elements by id...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
9ecbf4e060
commit
857c1ae9a7
@ -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] }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user