rails_modal_manager 1.0.43 → 1.0.45
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 35bbae9104923aaa6bc1fa87eacd8616c2ef0aaf538ed1210fb369c3f25e89e2
|
|
4
|
+
data.tar.gz: 34ba022c5adac89ff47c3f505215acef624056da6f48afaec02bc42e611e587e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f94273a89dcd52dba439b464196f7c3db208a28405c01f582227e81bb3c709f236074d6a5bca7c6dcdbf53dcf822357d47da9ae643aa23463f25a5d000b55d35
|
|
7
|
+
data.tar.gz: 2c8f6ffd4bfced2dcf0ae66a5f8b0f39b63d58fa490f5bbdc7e114f3cbd88810d6c73c054a435e5a3a041d5e3adc7ff67f4e323305f45ed3bb367b2e9748a278
|
|
@@ -297,6 +297,15 @@ export default class extends Controller {
|
|
|
297
297
|
const modal = this.element.closest('.rmm-modal')
|
|
298
298
|
if (!modal) return
|
|
299
299
|
|
|
300
|
+
// Abort all pending AJAX requests from all submenu controllers
|
|
301
|
+
modal.querySelectorAll('[data-controller*="rmm-submenu"]').forEach(el => {
|
|
302
|
+
const ctrl = this.application.getControllerForElementAndIdentifier(el, 'rmm-submenu')
|
|
303
|
+
if (ctrl && ctrl.currentAbortController) {
|
|
304
|
+
ctrl.currentAbortController.abort()
|
|
305
|
+
ctrl.currentAbortController = null
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
|
|
300
309
|
// Hide all submenu groups
|
|
301
310
|
modal.querySelectorAll('.rmm-submenu-group').forEach(group => {
|
|
302
311
|
group.classList.remove('rmm-submenu-group-active')
|
|
@@ -164,14 +164,18 @@ export default class extends Controller {
|
|
|
164
164
|
return
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
// Abort previous pending request
|
|
167
|
+
// Abort previous pending request from this controller
|
|
168
168
|
if (this.currentAbortController) {
|
|
169
169
|
this.currentAbortController.abort()
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
const abortController = new AbortController()
|
|
173
173
|
this.currentAbortController = abortController
|
|
174
|
-
|
|
174
|
+
|
|
175
|
+
// Global request counter on the shared content container
|
|
176
|
+
// This ensures cross-controller coordination (e.g., when switching sidebar groups)
|
|
177
|
+
const requestId = (parseInt(contentContainer.dataset.rmmRequestId || '0', 10) + 1)
|
|
178
|
+
contentContainer.dataset.rmmRequestId = requestId
|
|
175
179
|
|
|
176
180
|
// Show loading state
|
|
177
181
|
contentContainer.classList.add('rmm-tab-loading')
|
|
@@ -192,8 +196,9 @@ export default class extends Controller {
|
|
|
192
196
|
|
|
193
197
|
const html = await response.text()
|
|
194
198
|
|
|
195
|
-
// Validate: only update if this
|
|
196
|
-
|
|
199
|
+
// Validate: only update if this is still the latest request
|
|
200
|
+
// Uses the shared counter on the DOM element, not instance-level counter
|
|
201
|
+
if (parseInt(contentContainer.dataset.rmmRequestId, 10) !== requestId) {
|
|
197
202
|
return
|
|
198
203
|
}
|
|
199
204
|
|