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.
@@ -115,8 +115,12 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
115
115
  }
116
116
  }
117
117
 
118
- /** Регистрирует обработчик для поиска открытых задач и добавления в них панели */
119
- static registerTaskPanelWatcher() {
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
- } else {
141
- console.warn('saby-customizer - Не найден контейнер: "registerTaskPanelWatcher:pageEntityContainer"')
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
 
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  },
10
10
  "repository": "github:saby-customizer/saby-customizer.github.io",
11
11
  "license": "Unlicense",
12
- "version": "0.0.0-pre.37",
12
+ "version": "0.0.0-pre.38",
13
13
  "type": "module",
14
14
  "main": "./userscript.js",
15
15
  "exports": {