vgapp 0.6.7 → 0.6.8

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);
@@ -189,13 +189,12 @@ class VGModal extends BaseModule {
189
189
 
190
190
  setTimeout(() => {
191
191
  this._element.classList.remove(CLASS_NAME_SHOW);
192
- this._queueCallback(() => this._hideModal(openedModals), this._element, this._isAnimatedFade());
192
+ this._queueCallback(() => this._hideModal(openedModals, isLeaveBackDrop), this._element, this._isAnimatedFade());
193
193
  }, this._params.animation.delay);
194
194
  }
195
195
 
196
- _hideModal(openedModals) {
196
+ _hideModal(openedModals, isLeaveBackDrop) {
197
197
  this._element.style.display = 'none';
198
- //this._element.setAttribute('aria-hidden', true);
199
198
  this._element.removeAttribute('aria-modal');
200
199
  this._element.removeAttribute('role');
201
200
  this._isTransitioning = false;
@@ -206,13 +205,21 @@ class VGModal extends BaseModule {
206
205
  history.pushState("", document.title, window.location.pathname + window.location.search);
207
206
  }
208
207
 
209
- Backdrop.hide(() => {
208
+ if (!isLeaveBackDrop) {
209
+ Backdrop.hide(() => {
210
+ document.body.classList.remove(CLASS_NAME_OPEN);
211
+ this._resetAdjustments();
212
+ this._scrollBar.reset();
213
+
214
+ EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
215
+ })
216
+ } else {
210
217
  document.body.classList.remove(CLASS_NAME_OPEN);
211
218
  this._resetAdjustments();
212
219
  this._scrollBar.reset();
213
220
 
214
221
  EventHandler.trigger(this._element, EVENT_KEY_HIDDEN);
215
- })
222
+ }
216
223
  }
217
224
 
218
225
  _showElement(relatedTarget) {
@@ -221,7 +228,6 @@ class VGModal extends BaseModule {
221
228
  }
222
229
 
223
230
  this._element.style.display = 'block';
224
- //this._element.removeAttribute('aria-hidden');
225
231
  this._element.setAttribute('aria-modal', true);
226
232
  this._element.setAttribute('role', 'dialog');
227
233
  this._element.scrollTop = 0;
@@ -114,31 +114,32 @@ 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
 
124
123
  setTimeout(() => {
125
- _this._element.setAttribute('aria-expanded', false);
126
- _this._element.classList.remove(CLASS_NAME_SHOW);
124
+ this._element.setAttribute('aria-expanded', false);
125
+ this._element.classList.remove(CLASS_NAME_SHOW);
127
126
 
128
127
  const completeCallback = () => {
129
- if (_this._params.backdrop) {
130
- Backdrop.hide(function () {
131
- if (_this._params.overflow) {
132
- Overflow.destroy();
133
- }
134
- });
128
+ if (!isLeaveBackDrop) {
129
+ if (this._params.backdrop) {
130
+ Backdrop.hide(() => {
131
+ if (this._params.overflow) {
132
+ Overflow.destroy();
133
+ }
134
+ });
135
+ }
135
136
  }
136
137
 
137
- if (_this._params.overflow) {
138
+ if (this._params.overflow) {
138
139
  Overflow.destroy();
139
140
  }
140
141
 
141
- if (_this._params.hash) {
142
+ if (this._params.hash) {
142
143
  history.pushState("", document.title, window.location.pathname + window.location.search);
143
144
  }
144
145
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vgapp",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "",
5
5
  "author": {
6
6
  "name": "Vegas Studio",