rails_modal_manager 1.0.39 → 1.0.40
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: 0df266d9e80cbe4f6999522dfc7d42dd07614651f4e85fca57cd43bd59bd1f56
|
|
4
|
+
data.tar.gz: fd760622af26da416a71bf8928ae5247db821de551111f6b60d54c9f9462b01b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b121a1d40ea4d3f3f368e4f3cf69de017f2afa3fc999c3bc03377a376d0011912d970966e34d6d5310e42d5c65c2dc8aeeb1c5b398bfb7b53da14d5459d48a15
|
|
7
|
+
data.tar.gz: 169d8b9067a9ea55f0749324e1a349a634f0741a42c776b30e9410478dc20e6d0f1be3f50d2f0c30a048a4a00a45ee2cc9db92f10e1759de3817294e2b2e2fde
|
|
@@ -240,9 +240,19 @@ export default class extends Controller {
|
|
|
240
240
|
e.stopPropagation()
|
|
241
241
|
const modalId = e.currentTarget.dataset.modalId
|
|
242
242
|
if (modalId) {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
// 해당 그룹이 복구된 상태인지 확인
|
|
244
|
+
const groups = modalStore.getMinimizedModalGroups()
|
|
245
|
+
const group = groups.find(g => g.rootModalId === modalId)
|
|
246
|
+
|
|
247
|
+
if (group && group.isRestored) {
|
|
248
|
+
// 복구된 상태: taskbar에서만 제거, 모달은 유지
|
|
249
|
+
modalStore.clearMinimizedStateGroup(modalId)
|
|
250
|
+
} else {
|
|
251
|
+
// 최소화 상태: 확인 후 모달 닫기
|
|
252
|
+
const confirmed = window.confirm('이 모달을 닫으시겠습니까?')
|
|
253
|
+
if (confirmed) {
|
|
254
|
+
modalStore.closeModalWithDescendants(modalId)
|
|
255
|
+
}
|
|
246
256
|
}
|
|
247
257
|
}
|
|
248
258
|
}
|
|
@@ -575,6 +575,29 @@ class ModalStore {
|
|
|
575
575
|
this.notify();
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
+
/**
|
|
579
|
+
* Clear minimized state for a modal group (remove from taskbar but keep modal open)
|
|
580
|
+
* Used when closing taskbar item for a restored (visible) modal
|
|
581
|
+
* @param {string} modalId - Any modal ID in the group
|
|
582
|
+
*/
|
|
583
|
+
clearMinimizedStateGroup(modalId) {
|
|
584
|
+
const rootId = this.getRootModal(modalId);
|
|
585
|
+
const descendants = this.getAllDescendants(rootId);
|
|
586
|
+
const allModalIds = [rootId, ...descendants];
|
|
587
|
+
|
|
588
|
+
// isMinimized와 isRestored 모두 false로 설정 (taskbar에서 제거, 모달은 유지)
|
|
589
|
+
allModalIds.forEach(id => {
|
|
590
|
+
if (this.activeModals[id]) {
|
|
591
|
+
this.activeModals[id].isMinimized = false;
|
|
592
|
+
this.activeModals[id].isRestored = false;
|
|
593
|
+
delete this.activeModals[id].minimizedAt;
|
|
594
|
+
}
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
this.updateBodyScroll();
|
|
598
|
+
this.notify();
|
|
599
|
+
}
|
|
600
|
+
|
|
578
601
|
getMinimizedModalGroups() {
|
|
579
602
|
const minimizedRoots = new Set();
|
|
580
603
|
const processedModals = new Set();
|