rails_modal_manager 1.0.31 → 1.0.32
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: 137650bba1f5ded9e215a34fba7402a47e1f888641416a478acbeaee9fcc806b
|
|
4
|
+
data.tar.gz: a047f2a4c6a11f65d539e3df7aefb2e02bbdb8bf2a0194a67b52a66214e22d8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5786f1ea88a886ddd26132669b480c7b2d3ed2b3a456934d0d65b818c7faf9c83e76a5822fd662b74a6dbebebbecebbe51ab3edd04375b73fb7c14b16884d635
|
|
7
|
+
data.tar.gz: df5a7843b45cd6e126825d10b1600fc628a76db7d4f21ed596938e3c1d2367a051fde591d499bfac88cc88459696459f4b86950f24a155129d68d46c2abb5da1
|
|
@@ -109,12 +109,11 @@ export default class extends Controller {
|
|
|
109
109
|
// Save previous focus
|
|
110
110
|
this.previousFocus = document.activeElement
|
|
111
111
|
|
|
112
|
-
// Check for saved size
|
|
112
|
+
// Check for saved size (use persistentId or modalId)
|
|
113
113
|
let initialSize = this.sizeValue
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
114
|
+
const storageId = this.persistentIdValue || this.effectiveModalId
|
|
115
|
+
const savedSize = modalSizeStorage.load(storageId, modalUtils.isMobile())
|
|
116
|
+
if (savedSize) initialSize = savedSize
|
|
118
117
|
|
|
119
118
|
// Mobile default full size
|
|
120
119
|
if (modalUtils.isMobile() && this.mobileDefaultMaximizedValue) {
|
|
@@ -780,15 +779,20 @@ export default class extends Controller {
|
|
|
780
779
|
const config = modalStore.getModalConfig(modalId)
|
|
781
780
|
if (!config) return
|
|
782
781
|
|
|
782
|
+
const storageId = this.persistentIdValue || this.effectiveModalId
|
|
783
|
+
|
|
783
784
|
if (config.isMaximized) {
|
|
784
785
|
// Restore
|
|
786
|
+
const restoreSize = config.previousSize || this.sizeValue
|
|
785
787
|
modalStore.updateModal(modalId, {
|
|
786
788
|
isMaximized: false,
|
|
787
|
-
size:
|
|
789
|
+
size: restoreSize,
|
|
788
790
|
customPosition: null,
|
|
789
791
|
customWidth: null,
|
|
790
792
|
customHeight: null,
|
|
791
793
|
})
|
|
794
|
+
// Save restored size to localStorage
|
|
795
|
+
modalSizeStorage.save(storageId, restoreSize, modalUtils.isMobile())
|
|
792
796
|
} else {
|
|
793
797
|
// Maximize
|
|
794
798
|
modalStore.updateModal(modalId, {
|
|
@@ -799,6 +803,8 @@ export default class extends Controller {
|
|
|
799
803
|
customWidth: null,
|
|
800
804
|
customHeight: null,
|
|
801
805
|
})
|
|
806
|
+
// Save maximized size to localStorage
|
|
807
|
+
modalSizeStorage.save(storageId, 'full', modalUtils.isMobile())
|
|
802
808
|
}
|
|
803
809
|
|
|
804
810
|
this.applyStyles()
|
|
@@ -833,9 +839,9 @@ export default class extends Controller {
|
|
|
833
839
|
|
|
834
840
|
// applyStyles() will be called via handleStoreChange() from the store notification
|
|
835
841
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
842
|
+
// Save size to localStorage (use persistentId or modalId)
|
|
843
|
+
const storageId = this.persistentIdValue || this.effectiveModalId
|
|
844
|
+
modalSizeStorage.save(storageId, newSize, modalUtils.isMobile())
|
|
839
845
|
|
|
840
846
|
this.dispatch('sizeChange', { detail: { modalId: modalId, size: newSize } })
|
|
841
847
|
}
|