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.
@@ -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
 
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.34",
12
+ "version": "0.0.0-pre.37",
13
13
  "type": "module",
14
14
  "main": "./userscript.js",
15
15
  "exports": {