Allow specification of base for selector
This commit is contained in:
parent
ae2c113325
commit
24a75e935a
|
@ -94,14 +94,14 @@ export class Widget implements EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
set parent(p: string | ParentNode | null) {
|
set parent(p: string | ParentNode | null) {
|
||||||
if (typeof p === 'string') {
|
this.setParent(p);
|
||||||
p = document.querySelector(p);
|
|
||||||
}
|
|
||||||
this._parent.value = p;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setParent(p: string | ParentNode | null): this {
|
setParent(p: string | ParentNode | null, wrt: ParentNode = document): this {
|
||||||
this.parent = p;
|
if (typeof p === 'string') {
|
||||||
|
p = wrt.querySelector(p);
|
||||||
|
}
|
||||||
|
this._parent.value = p;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue