splitting in 2 events: toggleContent and showContent

pull/1/head
yann300 6 years ago
parent 33852ebc69
commit 831d71af50
  1. 8
      src/app/components/swap-panel-api.js
  2. 4
      src/app/components/vertical-icons-component.js

@ -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 {
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 {
} }
_iconClick (name) { _iconClick (name) {
this.select(name) this.removeActive()
this.addActive(name)
this.events.emit('toggleContent', name)
} }
render () { render () {

Loading…
Cancel
Save