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: f72c6ffe5c9f3e50fff79422b1807782c9f7ec6b8d2e24c7f3bce5b4ed82e908
4
- data.tar.gz: 118f90d8a19326d558115e337c6664d4c6e0ea5daeae119fcf10fbf2848a9f15
3
+ metadata.gz: 0df266d9e80cbe4f6999522dfc7d42dd07614651f4e85fca57cd43bd59bd1f56
4
+ data.tar.gz: fd760622af26da416a71bf8928ae5247db821de551111f6b60d54c9f9462b01b
5
5
  SHA512:
6
- metadata.gz: b901dc36606b53e8397779b2220fa860798abd4c2968067c3ce2c32140648f1ae98da01206f54498d9005454867c96260ca7166ca3beef91498d31bf4a7d8963
7
- data.tar.gz: 6565408604feecc0dd2990d65a7fde29c672446e4ad35f31301a61d31866589b6482266f88c02921fa0920b7505b1046ac9b6cd871aecad8f532960bec0cdb50
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
- const confirmed = window.confirm('이 모달을 닫으시겠습니까?')
244
- if (confirmed) {
245
- modalStore.closeModalWithDescendants(modalId)
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();
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsModalManager
4
- VERSION = "1.0.39"
4
+ VERSION = "1.0.40"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_modal_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.39
4
+ version: 1.0.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - reshacs