saby-customizer 0.0.0-pre.34 → 0.0.0-pre.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/saby-lib/toolbar.js +18 -1
- package/package.json +1 -1
package/lib/saby-lib/toolbar.js
CHANGED
|
@@ -118,10 +118,27 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
|
|
|
118
118
|
/** Регистрирует обработчик для поиска открытых задач и добавления в них панели */
|
|
119
119
|
static registerTaskPanelWatcher() {
|
|
120
120
|
const popupContainer = document.getElementById('popup')
|
|
121
|
+
const pageEntityContainer = document.querySelector('.onlinePage_Entity-wrapper.controls-Popup__dialog-target-container')
|
|
122
|
+
let timeout = null
|
|
123
|
+
|
|
124
|
+
this.observer = new MutationObserver(() => {
|
|
125
|
+
if (!timeout) {
|
|
126
|
+
timeout = setTimeout(() => {
|
|
127
|
+
this.addTaskPanelContainer()
|
|
128
|
+
timeout = null
|
|
129
|
+
}, 1000)
|
|
130
|
+
}
|
|
131
|
+
})
|
|
121
132
|
|
|
122
133
|
if (popupContainer) {
|
|
123
|
-
this.observer = new MutationObserver(() => this.addTaskPanelContainer())
|
|
124
134
|
this.observer.observe(popupContainer, { childList: true, subtree: true })
|
|
135
|
+
} else {
|
|
136
|
+
console.warn('saby-customizer - Не найден контейнер: "registerTaskPanelWatcher:popupContainer"')
|
|
137
|
+
}
|
|
138
|
+
if (pageEntityContainer) {
|
|
139
|
+
this.observer.observe(pageEntityContainer, { childList: true, subtree: true })
|
|
140
|
+
} else {
|
|
141
|
+
console.warn('saby-customizer - Не найден контейнер: "registerTaskPanelWatcher:pageEntityContainer"')
|
|
125
142
|
}
|
|
126
143
|
}
|
|
127
144
|
|