saby-customizer 0.0.0-pre.37 → 0.0.0-pre.38
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 +16 -6
- package/package.json +1 -1
package/lib/saby-lib/toolbar.js
CHANGED
|
@@ -115,8 +115,12 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
/**
|
|
119
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Регистрирует обработчик для поиска открытых задач и добавления в них панели
|
|
120
|
+
*
|
|
121
|
+
* @param {{searchCount:number}} options Опции регистарции обработчиков
|
|
122
|
+
*/
|
|
123
|
+
static registerTaskPanelWatcher({ searchCount } = { searchCount: 0 }) {
|
|
120
124
|
const popupContainer = document.getElementById('popup')
|
|
121
125
|
const pageEntityContainer = document.querySelector('.onlinePage_Entity-wrapper.controls-Popup__dialog-target-container')
|
|
122
126
|
let timeout = null
|
|
@@ -132,13 +136,19 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
|
|
|
132
136
|
|
|
133
137
|
if (popupContainer) {
|
|
134
138
|
this.observer.observe(popupContainer, { childList: true, subtree: true })
|
|
135
|
-
} else {
|
|
136
|
-
console.warn('saby-customizer - Не найден контейнер: "registerTaskPanelWatcher:popupContainer"')
|
|
137
139
|
}
|
|
138
140
|
if (pageEntityContainer) {
|
|
139
141
|
this.observer.observe(pageEntityContainer, { childList: true, subtree: true })
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
+
}
|
|
143
|
+
if (!popupContainer && !pageEntityContainer) {
|
|
144
|
+
if (searchCount < 5) {
|
|
145
|
+
searchCount++
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
this.registerTaskPanelWatcher({ searchCount })
|
|
148
|
+
}, 1000)
|
|
149
|
+
} else {
|
|
150
|
+
console.error('saby-customizer - registerTaskPanelWatcher: Не найден ни один общий контейнер для размещения доп. панелей с кнопками')
|
|
151
|
+
}
|
|
142
152
|
}
|
|
143
153
|
}
|
|
144
154
|
|