mirror of
https://github.com/flynx/pWiki.git
synced 2025-12-23 11:31:39 +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 },
|
return path },
|
||||||
|
|
||||||
//
|
//
|
||||||
// .get([<offset>])
|
// .get(<index>)[, <offset>]
|
||||||
|
// .get(<path>[, <offset>])
|
||||||
|
// .get(<id>[, <offset>)
|
||||||
|
// -> <node>
|
||||||
|
//
|
||||||
// .get('focused'[, <offset>])
|
// .get('focused'[, <offset>])
|
||||||
// -> <node>
|
// -> <node>
|
||||||
//
|
//
|
||||||
@ -736,6 +740,10 @@ var Outline = {
|
|||||||
: offset
|
: offset
|
||||||
var outline = this.outline
|
var outline = this.outline
|
||||||
|
|
||||||
|
// id...
|
||||||
|
if(typeof(node) == 'string' && node[0] == '#'){
|
||||||
|
node = outline.querySelector(node) }
|
||||||
|
|
||||||
// root nodes...
|
// root nodes...
|
||||||
if(node == 'top'){
|
if(node == 'top'){
|
||||||
return [...outline.children] }
|
return [...outline.children] }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user