| 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() |