Commit 831d71af authored by yann300's avatar yann300

splitting in 2 events: toggleContent and showContent

parent 33852ebc
...@@ -5,7 +5,7 @@ class SwapPanelApi { ...@@ -5,7 +5,7 @@ class SwapPanelApi {
this.event = new EventEmmitter() this.event = new EventEmmitter()
this.component = swapPanelComponent this.component = swapPanelComponent
this.currentContent this.currentContent
verticalIconsComponent.events.on('showContent', (moduleName) => { verticalIconsComponent.events.on('toggleContent', (moduleName) => {
if (!swapPanelComponent.contents[moduleName]) return if (!swapPanelComponent.contents[moduleName]) return
if (this.currentContent === moduleName) { if (this.currentContent === moduleName) {
this.event.emit('toggle', moduleName) this.event.emit('toggle', moduleName)
...@@ -14,6 +14,12 @@ class SwapPanelApi { ...@@ -14,6 +14,12 @@ class SwapPanelApi {
this.showContent(moduleName) this.showContent(moduleName)
this.event.emit('showing', moduleName) this.event.emit('showing', moduleName)
}) })
verticalIconsComponent.events.on('showContent', (moduleName) => {
if (!swapPanelComponent.contents[moduleName]) return
this.showContent(moduleName)
this.event.emit('showing', moduleName)
})
} }
showContent (moduleName) { showContent (moduleName) {
......
...@@ -209,7 +209,9 @@ class VerticalIconComponent { ...@@ -209,7 +209,9 @@ class VerticalIconComponent {
} }
_iconClick (name) { _iconClick (name) {
this.select(name) this.removeActive()
this.addActive(name)
this.events.emit('toggleContent', name)
} }
render () { render () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment