saby-customizer 0.0.0-pre.35 → 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
@@ -126,7 +130,7 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
126
130
  timeout = setTimeout(() => {
127
131
  this.addTaskPanelContainer()
128
132
  timeout = null
129
- }, 100)
133
+ }, 1000)
130
134
  }
131
135
  })
132
136
 
@@ -136,6 +140,16 @@ class ToolbarContainer extends oom.extends(HTMLElement, optionsDefaults) {
136
140
  if (pageEntityContainer) {
137
141
  this.observer.observe(pageEntityContainer, { childList: true, subtree: true })
138
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
+ }
152
+ }
139
153
  }
140
154
 
141
155
  /** Добавления во все найденные открытые задачи правую панель */
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.35",
12
+ "version": "0.0.0-pre.38",
13
13
  "type": "module",
14
14
  "main": "./userscript.js",
15
15
  "exports": {