rails_modal_manager 1.0.38 → 1.0.39
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: f72c6ffe5c9f3e50fff79422b1807782c9f7ec6b8d2e24c7f3bce5b4ed82e908
|
|
4
|
+
data.tar.gz: 118f90d8a19326d558115e337c6664d4c6e0ea5daeae119fcf10fbf2848a9f15
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b901dc36606b53e8397779b2220fa860798abd4c2968067c3ce2c32140648f1ae98da01206f54498d9005454867c96260ca7166ca3beef91498d31bf4a7d8963
|
|
7
|
+
data.tar.gz: 6565408604feecc0dd2990d65a7fde29c672446e4ad35f31301a61d31866589b6482266f88c02921fa0920b7505b1046ac9b6cd871aecad8f532960bec0cdb50
|
|
@@ -48,6 +48,8 @@ export default class extends Controller {
|
|
|
48
48
|
this.previousFocus = null
|
|
49
49
|
this.isDragging = false
|
|
50
50
|
this.isResizing = false
|
|
51
|
+
this.isClosing = false
|
|
52
|
+
this.closeTimeout = null
|
|
51
53
|
this.dragStart = { x: 0, y: 0 }
|
|
52
54
|
this.initialPos = { top: 0, left: 0 }
|
|
53
55
|
this.resizeDirection = null
|
|
@@ -107,6 +109,12 @@ export default class extends Controller {
|
|
|
107
109
|
open() {
|
|
108
110
|
const modalId = this.effectiveModalId
|
|
109
111
|
|
|
112
|
+
// 닫기 애니메이션 중이면 취소하고 다시 열기
|
|
113
|
+
if (this.isClosing) {
|
|
114
|
+
this.cancelClose()
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
if (modalStore.getModalConfig(modalId)) {
|
|
111
119
|
return // Already open
|
|
112
120
|
}
|
|
@@ -177,6 +185,12 @@ export default class extends Controller {
|
|
|
177
185
|
close(source = 'button') {
|
|
178
186
|
const modalId = this.effectiveModalId
|
|
179
187
|
|
|
188
|
+
// 이미 닫는 중이면 무시
|
|
189
|
+
if (this.isClosing) return
|
|
190
|
+
|
|
191
|
+
// store에 없으면 이미 닫힌 상태
|
|
192
|
+
if (!modalStore.getModalConfig(modalId)) return
|
|
193
|
+
|
|
180
194
|
// Allow closing from programmatic source, footer button, or if closable is true
|
|
181
195
|
if (!this.closableValue && source !== 'programmatic' && source !== 'footer') {
|
|
182
196
|
return
|
|
@@ -188,6 +202,9 @@ export default class extends Controller {
|
|
|
188
202
|
return
|
|
189
203
|
}
|
|
190
204
|
|
|
205
|
+
// 닫기 시작
|
|
206
|
+
this.isClosing = true
|
|
207
|
+
|
|
191
208
|
// Get all descendants to close them too
|
|
192
209
|
const descendants = modalStore.getAllDescendants(modalId)
|
|
193
210
|
|
|
@@ -402,7 +419,13 @@ export default class extends Controller {
|
|
|
402
419
|
modal.classList.remove('rmm-active')
|
|
403
420
|
if (overlay) overlay.classList.remove('rmm-active')
|
|
404
421
|
|
|
405
|
-
|
|
422
|
+
// 타이머 저장 (취소 가능하도록)
|
|
423
|
+
this.closeTimeout = setTimeout(() => {
|
|
424
|
+
this.closeTimeout = null
|
|
425
|
+
|
|
426
|
+
// 닫기가 취소되었으면 콜백 실행 안 함
|
|
427
|
+
if (!this.isClosing) return
|
|
428
|
+
|
|
406
429
|
// 애니메이션 완료 후 드래그로 인한 커스텀 위치 클래스 및 인라인 스타일 제거
|
|
407
430
|
modal.classList.remove('rmm-custom-position')
|
|
408
431
|
modal.classList.remove('rmm-dragging')
|
|
@@ -416,10 +439,32 @@ export default class extends Controller {
|
|
|
416
439
|
this.openValue = false
|
|
417
440
|
this._closingProgrammatically = false
|
|
418
441
|
|
|
442
|
+
// 닫기 완료
|
|
443
|
+
this.isClosing = false
|
|
444
|
+
|
|
419
445
|
if (callback) callback()
|
|
420
446
|
}, this.animationDurationValue)
|
|
421
447
|
}
|
|
422
448
|
|
|
449
|
+
/**
|
|
450
|
+
* Cancel ongoing close animation and restore modal visibility
|
|
451
|
+
* Called when open() is triggered during close animation
|
|
452
|
+
*/
|
|
453
|
+
cancelClose() {
|
|
454
|
+
if (this.closeTimeout) {
|
|
455
|
+
clearTimeout(this.closeTimeout)
|
|
456
|
+
this.closeTimeout = null
|
|
457
|
+
}
|
|
458
|
+
this.isClosing = false
|
|
459
|
+
|
|
460
|
+
// UI 다시 활성화
|
|
461
|
+
const modal = this.element
|
|
462
|
+
const overlay = this.getOverlay()
|
|
463
|
+
|
|
464
|
+
modal.classList.add('rmm-active')
|
|
465
|
+
if (overlay) overlay.classList.add('rmm-active')
|
|
466
|
+
}
|
|
467
|
+
|
|
423
468
|
/**
|
|
424
469
|
* Reset sidebar and submenu controllers to first item
|
|
425
470
|
* Called when modal is closed to ensure clean state on next open
|