limit popup depth live
This commit is contained in:
parent
61a96e327a
commit
1df59d57b5
@ -30,7 +30,8 @@ class Frontend extends TextScanner {
|
||||
super(
|
||||
window,
|
||||
popup.isProxy() ? [] : [popup.getContainer()],
|
||||
[(x, y) => this.popup.containsPoint(x, y)]
|
||||
[(x, y) => this.popup.containsPoint(x, y)],
|
||||
() => this.popup.depth <= this.options.scanning.popupNestingMaxDepth
|
||||
);
|
||||
|
||||
this.popup = popup;
|
||||
|
@ -22,11 +22,13 @@
|
||||
*/
|
||||
|
||||
class TextScanner {
|
||||
constructor(node, ignoreElements, ignorePoints) {
|
||||
constructor(node, ignoreElements, ignorePoints, canEnable=null) {
|
||||
this.node = node;
|
||||
this.ignoreElements = ignoreElements;
|
||||
this.ignorePoints = ignorePoints;
|
||||
|
||||
this.canEnable = canEnable;
|
||||
|
||||
this.ignoreNodes = null;
|
||||
|
||||
this.scanTimerPromise = null;
|
||||
@ -225,6 +227,10 @@ class TextScanner {
|
||||
}
|
||||
|
||||
setEnabled(enabled) {
|
||||
if (this.canEnable !== null && !this.canEnable()) {
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
if (!this.enabled) {
|
||||
this.hookEvents();
|
||||
|
Loading…
Reference in New Issue
Block a user