its_ui_vite 1.1.13 → 1.1.14
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/package.json +1 -1
- package/src/assets/js/helpers.js +12 -5
package/package.json
CHANGED
package/src/assets/js/helpers.js
CHANGED
|
@@ -57,6 +57,7 @@ export const CClasses = {
|
|
|
57
57
|
|
|
58
58
|
export function addTracingElement(target, moveFn = () => {}) {
|
|
59
59
|
let timer;
|
|
60
|
+
let interval;
|
|
60
61
|
let debounceTimer;
|
|
61
62
|
let positionInfo;
|
|
62
63
|
let lockPosition = true;
|
|
@@ -134,15 +135,21 @@ export function addTracingElement(target, moveFn = () => {}) {
|
|
|
134
135
|
|
|
135
136
|
if (isMoveTarget(position)) dispatch(positionInfo);
|
|
136
137
|
|
|
137
|
-
// здесь
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
// здесь interval т.к. некоторые элементы могут двигатся после onMounted (к примеру попапы на карте)
|
|
139
|
+
clearInterval(interval);
|
|
140
|
+
interval = setInterval(() => {
|
|
140
141
|
const position = target.value?.getBoundingClientRect();
|
|
141
|
-
lockPosition = true;
|
|
142
142
|
|
|
143
143
|
setPositionInfo(position);
|
|
144
144
|
dispatch(positionInfo);
|
|
145
145
|
}, 200);
|
|
146
|
+
|
|
147
|
+
// здесь debounce т.к. не всегда привязанный элемент встает на место
|
|
148
|
+
clearTimeout(debounceTimer);
|
|
149
|
+
debounceTimer = setTimeout(() => {
|
|
150
|
+
clearInterval(interval);
|
|
151
|
+
lockPosition = true;
|
|
152
|
+
}, 1250);
|
|
146
153
|
}, 100);
|
|
147
154
|
}
|
|
148
155
|
|
|
@@ -160,7 +167,7 @@ export function addTracingElement(target, moveFn = () => {}) {
|
|
|
160
167
|
document.body.addEventListener('mousedown', setDargHandler)
|
|
161
168
|
document.body.addEventListener('mouseup', setDargHandler)
|
|
162
169
|
|
|
163
|
-
|
|
170
|
+
targetMoveHandler();
|
|
164
171
|
}
|
|
165
172
|
|
|
166
173
|
function removeListeners() {
|