MCPcopy Create free account
hub / github.com/codecombat/codecombat / onTabShown

Method onTabShown

app/views/play/menu/GameMenuModal.js:122–138  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

120 }
121
122 onTabShown (e) {
123 this.playSound('game-menu-tab-switch')
124 const shownSubviewKey = e.target.hash.substring(1).replace(/-/g, '_')
125 if (typeof this.subviews[shownSubviewKey].onShown === 'function') {
126 this.subviews[shownSubviewKey].onShown()
127 }
128 return (() => {
129 const result = []
130 for (const subviewKey in this.subviews) {
131 const subview = this.subviews[subviewKey]
132 if (subviewKey !== shownSubviewKey) {
133 result.push((typeof subview.onHidden === 'function' ? subview.onHidden() : undefined))
134 }
135 }
136 return result
137 })()
138 }
139
140 onHidden () {
141 super.onHidden()

Callers

nothing calls this directly

Calls 2

onShownMethod · 0.45
onHiddenMethod · 0.45

Tested by

no test coverage detected