vgapp 0.6.7 → 0.6.9

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/CHANGELOG.md CHANGED
@@ -1,13 +1,25 @@
1
+ # VEGAS-APP 0.6.6 - 0.6.8 (Ноябрь, 17, 2025)
2
+ * isLeaveBackDrop (boolean) - для методов .hide() модулей VGModal и VGSidebar. Если программно нужно сменить модалки или сайдбары и/или одно на другое при этом не будет затронут задний фон Backdrop
3
+ * Исправлены ошибки в разных модулях
4
+
5
+ ---
6
+
1
7
  # VEGAS-APP 0.6.2 - 0.6.5 (Ноябрь, 10, 2025)
2
8
  * Исправлены ошибки в разных модулях
3
9
 
10
+ ---
11
+
4
12
  # VEGAS-APP 0.5.6 - 0.6.1 (Август, 21, 2025)
5
13
  * Разделение JS и CSS
6
14
  * Исправлены ошибки в разных модулях
7
15
 
16
+ ---
17
+
8
18
  # VEGAS-APP 0.4.6 - 0.5.5 (Июнь, 21, 2025)
9
19
  * Исправлены ошибки в разных модулях
10
20
 
21
+ ---
22
+
11
23
  # VEGAS-APP 0.4.3 - 0.4.6 (Июнь, 3, 2025)
12
24
  * Исправлены ошибки в разных модулях
13
25
  * Во все модули, где есть группа параметров ajax, добавлен параметр output (boolean),
@@ -15,6 +27,7 @@
15
27
  * Во все модули, где есть группа параметров ajax, добавлен параметр once (boolean),
16
28
  разовый запрос на сервер
17
29
 
30
+ ---
18
31
  ## Модуль VGRollup
19
32
  * Исправлено, последовательное открытие свернутого контента
20
33
 
@@ -149,7 +149,7 @@ class VGModal extends BaseModule {
149
149
  show(relatedTarget) {
150
150
  if (isDisabled(this._element)) return;
151
151
 
152
- if (this._params.ajax.route && this._params.ajax.target) {
152
+ if (this._params.ajax.route && this._params.ajax.target && !this._params.ajax.once) {
153
153
  const ajaxTargetContent = Selectors.find(this._params.ajax.target, this._element);
154
154
  if (ajaxTargetContent) ajaxTargetContent.innerHTML = '';
155
155
  }
@@ -178,7 +178,7 @@ class VGModal extends BaseModule {
178
178
  Backdrop.show(() => this._showElement(relatedTarget));
179
179
  }
180
180
 
181
- hide(openedModals = []) {
181
+ hide(openedModals = [], isLeaveBackDrop = false) {
182
182
  if (!this._isShown || this._isTransitioning) return;
183
183
 
184
184
  const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
@@ -187,32 +187,34 @@ class VGModal extends BaseModule {
187
187
  this._isShown = false;
188
188
  this._isTransitioning = true;
189
189
 
190
+ document.body.classList.remove(CLASS_NAME_OPEN);
191
+
190
192
  setTimeout(() => {
191
193
  this._element.classList.remove(CLASS_NAME_SHOW);
192
- this._queueCallback(() => this._hideModal(openedModals), this._element, this._isAnimatedFade());
194
+ this._queueCallback(() => this._hideModal(openedModals, isLeaveBackDrop), this._element, this._isAnimatedFade());
193
195
  }, this._params.animation.delay);
194
196
  }
195
197
 
196
- _hideModal(openedModals) {
197
- this._element.style.display = 'none';
198
- //this._element.setAttribute('aria-hidden', true);
199
- this._element.removeAttribute('aria-modal');
200
- this._element.removeAttribute('role');
201
- this._isTransitioning = false;
198
+ _hideModal(openedModals, isLeaveBackDrop) {
199
+ if (!isLeaveBackDrop) {
200
+ this._element.style.display = 'none';
201
+ this._element.removeAttribute('aria-modal');
202
+ this._element.removeAttribute('role');
203
+ this._isTransitioning = false;
202
204
 
203
- if (openedModals.length) return;
205
+ if (openedModals.length) return;
204
206
 
205
- if (this._params.hash) {
206
- history.pushState("", document.title, window.location.pathname + window.location.search);
207
- }
207
+ if (this._params.hash) {
208
+ history.pushState("", document.title, window.location.pathname + window.location.search);
209
+ }
208
210
 
209
- Backdrop.hide(() => {
210
- document.body.classList.remove(CLASS_NAME_OPEN);
211
- this._resetAdjustments();
212
- this._scrollBar.reset();
211
+ Backdrop.hide(() => {
212
+ this._resetAdjustments();
213
+ this._scrollBar.reset();
213
214
 
214
- EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
215
- })
215
+ EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
216
+ })
217
+ }
216
218
  }
217
219
 
218
220
  _showElement(relatedTarget) {
@@ -221,7 +223,6 @@ class VGModal extends BaseModule {
221
223
  }
222
224
 
223
225
  this._element.style.display = 'block';
224
- //this._element.removeAttribute('aria-hidden');
225
226
  this._element.setAttribute('aria-modal', true);
226
227
  this._element.setAttribute('role', 'dialog');
227
228
  this._element.scrollTop = 0;
@@ -114,36 +114,38 @@ class VGSidebar extends BaseModule {
114
114
  _this._queueCallback(completeCallBack, _this._element, true, 50)
115
115
  }
116
116
 
117
- hide() {
118
- const _this = this;
119
- if (isDisabled(_this._element)) return;
117
+ hide(isLeaveBackDrop = false) {
118
+ if (isDisabled(this._element)) return;
120
119
 
121
120
  const hideEvent = EventHandler.trigger(this._element, EVENT_KEY_HIDE);
122
121
  if (hideEvent.defaultPrevented) return;
123
122
 
123
+ document.body.classList.remove(CLASS_NAME_OPEN);
124
+
124
125
  setTimeout(() => {
125
- _this._element.setAttribute('aria-expanded', false);
126
- _this._element.classList.remove(CLASS_NAME_SHOW);
126
+ this._element.setAttribute('aria-expanded', false);
127
+ this._element.classList.remove(CLASS_NAME_SHOW);
127
128
 
128
129
  const completeCallback = () => {
129
- if (_this._params.backdrop) {
130
- Backdrop.hide(function () {
131
- if (_this._params.overflow) {
132
- Overflow.destroy();
133
- }
134
- });
135
- }
136
-
137
- if (_this._params.overflow) {
138
- Overflow.destroy();
139
- }
140
-
141
- if (_this._params.hash) {
142
- history.pushState("", document.title, window.location.pathname + window.location.search);
130
+ if (!isLeaveBackDrop) {
131
+ if (this._params.backdrop) {
132
+ Backdrop.hide(() => {
133
+ if (this._params.overflow) {
134
+ Overflow.destroy();
135
+ }
136
+ });
137
+ }
138
+
139
+ if (this._params.overflow) {
140
+ Overflow.destroy();
141
+ }
142
+
143
+ if (this._params.hash) {
144
+ history.pushState("", document.title, window.location.pathname + window.location.search);
145
+ }
146
+
147
+ EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
143
148
  }
144
-
145
- document.body.classList.remove(CLASS_NAME_OPEN);
146
- EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
147
149
  }
148
150
  this._queueCallback(completeCallback, this._element, true);
149
151
  }, this._params.animation.delay);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vgapp",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "description": "",
5
5
  "author": {
6
6
  "name": "Vegas Studio",