rails_modal_manager 1.0.14 → 1.0.15

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: b5a9a0c23b9c295ce794dca604668be79268eab2b0ef9aa3a72bce9f31642d37
4
- data.tar.gz: f341afe4a3bcf1661a80a60fbbd8ad2c34b187f6fe15d04df16c57f9273bafdc
3
+ metadata.gz: 736e63cc3f81769e168c0945753f8cc1f2f4a8e840fb18a6768f10a76e80f7cc
4
+ data.tar.gz: 8d4cd784e878b2ff7fd5baca62d25c8b9fbd0aefc53caae82f86710805a2f4b5
5
5
  SHA512:
6
- metadata.gz: 4213097d0638e6e1656a3bab74608e7ab6adcc1aa521532fefbb0fc74e8d248d0e6a5a672f60f9d7a1b0a7a3dd345acdf6f5112ec74ea8a7a97fc3762cc8f913
7
- data.tar.gz: 5c9bd6533b30f62eae37e28d6ae6532ed7942f74cb45d8d62db8dc6d31c35797322fb83db2e9c258599ef0b78c8ee16f565ae827bc2080a329019719c2a30e56
6
+ metadata.gz: 235e07f2e6e39617031bf18115bbf775345488aa369331acf2803cd12a0607464b2b4e2507c807957665e85b67731850ee7f84db37b034b00e53cd83773e950f
7
+ data.tar.gz: b9aca2397fdeb003b14ba3f368f76cb60aed7744486534df7fb81de688730b0c5c58144c297a30bb90df98166229b05cb745ef8ef7e00a88db3972b3d68e8c7c
@@ -40,10 +40,14 @@ export default class extends Controller {
40
40
  this.element.classList.add('rmm-sidebar-collapsed')
41
41
  }
42
42
 
43
- // Find initial active item
43
+ // Find initial active item and restore its state
44
44
  const activeItem = this.element.querySelector('.rmm-sidebar-item.rmm-active')
45
45
  if (activeItem) {
46
46
  this.currentItemId = activeItem.dataset.itemId
47
+ // Restore panel and submenu state for the active item
48
+ // This ensures content is properly displayed when modal is reopened
49
+ this.switchPanel(activeItem)
50
+ this.switchSubmenuGroup(activeItem)
47
51
  }
48
52
 
49
53
  // Listen for toggle event from header button
@@ -45,10 +45,17 @@ export default class extends Controller {
45
45
  this.ajaxCache = new Map()
46
46
  this.currentItemId = null
47
47
 
48
- // Find initial active item
48
+ // Find initial active item and restore its state
49
49
  const activeItem = this.element.querySelector('.rmm-submenu-item.rmm-active')
50
50
  if (activeItem) {
51
51
  this.currentItemId = activeItem.dataset.itemId
52
+ // Restore panel state for the active item
53
+ // This ensures content is properly displayed when modal is reopened
54
+ if (this.loadModeValue === 'ajax') {
55
+ this.loadAjaxContent(activeItem)
56
+ } else {
57
+ this.switchPanel(activeItem)
58
+ }
52
59
  }
53
60
  }
54
61
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsModalManager
4
- VERSION = "1.0.14"
4
+ VERSION = "1.0.15"
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.14
4
+ version: 1.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - reshacs