rails_modal_manager 1.0.26 → 1.0.27

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: f2c7e861b06a7a378dc21ec988f07b02b0935149b585852976b0ceb50e0cd8d3
4
- data.tar.gz: c010260ca9554d2b1d5cd308db92b02594bfeb35b344a9cd3c6c26c51eaec788
3
+ metadata.gz: e919b275fd361881663b301cd23661d0ac6bb593c2798eb2a77b0bb231e4f4c1
4
+ data.tar.gz: 553fe6e5cc9235cd0c87997d07c630795893c235a79983416d8423d65a4f013d
5
5
  SHA512:
6
- metadata.gz: bdbfdfaa241ed600e1dbe673f66f5fc41b7b4decb89647f8a372dcf8d6e668020593189029036b0e9ebb99e0b7943b363269bcca9dfb0aef4d2279d716018f7a
7
- data.tar.gz: e1f8b65751b40fec5a418f7a9063690429fd6c046b01d7793e6e88032110bf2a7a52a5e3fffcb29254985aa01358b24abf8906cb362d65e83b6b9cea5d4345b0
6
+ metadata.gz: 18794e80fb189d47781ba21e1a673499f459cabcc835509c97d87748d5ad16781634a2341796b3e14c45f6442a0af1643b80c0a534dbf3075696bf690a785396
7
+ data.tar.gz: 2f26034a4577fba61a50ab77292203df2c2f4916f4b9dbe8b9879ea30e93baeae66b896dd75f23d73f9713e80cee0f8171fcb24dab7d50b93348a18b95891b84
@@ -204,13 +204,20 @@ export default class extends Controller {
204
204
  if (!this.refreshOnReselectValue) {
205
205
  return
206
206
  }
207
- // refreshOnReselect가 true면 이벤트만 발생 (UI 변경 없음)
207
+
208
+ // 서브메뉴가 있는 경우 forceReloadActive 호출하여 콘텐츠 새로고침
209
+ const submenuId = item.dataset.submenuId
210
+ if (submenuId) {
211
+ this.triggerSubmenuReload(submenuId)
212
+ }
213
+
214
+ // 이벤트 발생
208
215
  this.dispatch('itemSelect', {
209
216
  detail: {
210
217
  modalId: this.modalIdValue,
211
218
  itemId: item.dataset.itemId,
212
219
  itemLabel: item.dataset.itemLabel,
213
- hasSubmenu: !!item.dataset.submenuId,
220
+ hasSubmenu: !!submenuId,
214
221
  isReselect: true,
215
222
  }
216
223
  })
@@ -393,6 +400,29 @@ export default class extends Controller {
393
400
  })
394
401
  }
395
402
 
403
+ /**
404
+ * Trigger submenu reload for reselected sidebar item
405
+ */
406
+ triggerSubmenuReload(submenuId) {
407
+ const modal = this.element.closest('.rmm-modal')
408
+ if (!modal) return
409
+
410
+ const targetSubmenu = modal.querySelector(`#${submenuId}`)
411
+ if (!targetSubmenu) return
412
+
413
+ const submenuElement = targetSubmenu.querySelector('[data-controller*="rmm-submenu"]')
414
+ if (!submenuElement) return
415
+
416
+ const submenuController = this.application.getControllerForElementAndIdentifier(
417
+ submenuElement,
418
+ 'rmm-submenu'
419
+ )
420
+
421
+ if (submenuController && typeof submenuController.forceReloadActive === 'function') {
422
+ submenuController.forceReloadActive()
423
+ }
424
+ }
425
+
396
426
  /**
397
427
  * Switch submenu group for reset (without triggering content reload)
398
428
  * This version doesn't call forceReloadActive to avoid duplicate loads
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsModalManager
4
- VERSION = "1.0.26"
4
+ VERSION = "1.0.27"
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.26
4
+ version: 1.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - reshacs