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: 2f31b5d2f94a210b09776bdba0fb0e28bbefe99ec017337304eecc7f1de43bc7
4
- data.tar.gz: b948dd4e2969c0629893935ffd8b2fc42bf81d9012679a6eada70102acc6d153
3
+ metadata.gz: 137650bba1f5ded9e215a34fba7402a47e1f888641416a478acbeaee9fcc806b
4
+ data.tar.gz: a047f2a4c6a11f65d539e3df7aefb2e02bbdb8bf2a0194a67b52a66214e22d8d
5
5
  SHA512:
6
- metadata.gz: 54971d4a854cb1098db23448e9edd3d3e6beaaea58076403cc148cb935a1820095b6efefe1452f7d836fb246325ed7d42362f1afef9cca361bedb12b6106474d
7
- data.tar.gz: 4609e53d90aa011638b9d73201716dbe0b751ecefa570bc622802a928f5a64052c793757a8df8d3e4b479079e0ded821b91e12afd7c8ad401b8ba6119e39ddba
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
- if (this.persistentIdValue) {
115
- const savedSize = modalSizeStorage.load(this.persistentIdValue, modalUtils.isMobile())
116
- if (savedSize) initialSize = savedSize
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: config.previousSize || this.sizeValue,
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
- if (this.persistentIdValue) {
837
- modalSizeStorage.save(this.persistentIdValue, newSize, modalUtils.isMobile())
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
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsModalManager
4
- VERSION = "1.0.31"
4
+ VERSION = "1.0.32"
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.31
4
+ version: 1.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - reshacs