Show inventory view now, for hero levels.
This commit is contained in:
parent
632559f7db
commit
e615dde6e2
2 changed files with 5 additions and 6 deletions
app
|
@ -8,8 +8,9 @@ block modal-body-content
|
||||||
- if (!showDevBits) { // Not done yet.
|
- if (!showDevBits) { // Not done yet.
|
||||||
- submenus.splice(4, 1);
|
- submenus.splice(4, 1);
|
||||||
- submenus.splice(2, 1);
|
- submenus.splice(2, 1);
|
||||||
- submenus.splice(0, 1);
|
|
||||||
- }
|
- }
|
||||||
|
- if (!showInventory)
|
||||||
|
- submenus.splice(0, 1);
|
||||||
ul.nav.nav-tabs
|
ul.nav.nav-tabs
|
||||||
for submenu, index in submenus
|
for submenu, index in submenus
|
||||||
li(class=index ? "" : "active")
|
li(class=index ? "" : "active")
|
||||||
|
@ -19,10 +20,6 @@ block modal-body-content
|
||||||
.tab-content
|
.tab-content
|
||||||
for submenu, index in submenus
|
for submenu, index in submenus
|
||||||
.tab-pane(id=submenu + '-view')
|
.tab-pane(id=submenu + '-view')
|
||||||
h3= submenu + submenu + submenu
|
|
||||||
p
|
|
||||||
| Lorem ipsum dolor sit amet, charetra varius quam sit amet vulputate.
|
|
||||||
| Quisque mauris augue, molestie tincidunt condimentum vitae, gravida a libero.
|
|
||||||
.clearfix
|
.clearfix
|
||||||
|
|
||||||
block modal-footer
|
block modal-footer
|
|
@ -18,6 +18,7 @@ module.exports = class GameMenuModal extends ModalView
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
super options
|
super options
|
||||||
@options.showDevBits = me.isAdmin() or /https?:\/\/localhost/.test(window.location.href)
|
@options.showDevBits = me.isAdmin() or /https?:\/\/localhost/.test(window.location.href)
|
||||||
|
@options.showInventory = @options.level.get('type', true) is 'hero'
|
||||||
|
|
||||||
events:
|
events:
|
||||||
'change input.select': 'onSelectionChanged'
|
'change input.select': 'onSelectionChanged'
|
||||||
|
@ -25,13 +26,14 @@ module.exports = class GameMenuModal extends ModalView
|
||||||
getRenderData: (context={}) ->
|
getRenderData: (context={}) ->
|
||||||
context = super(context)
|
context = super(context)
|
||||||
context.showDevBits = @options.showDevBits
|
context.showDevBits = @options.showDevBits
|
||||||
|
context.showInventory = @options.showInventory
|
||||||
context
|
context
|
||||||
|
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
super()
|
super()
|
||||||
@$el.toggleClas
|
@$el.toggleClas
|
||||||
@insertSubView new submenuView @options for submenuView in submenuViews
|
@insertSubView new submenuView @options for submenuView in submenuViews
|
||||||
(if @options.showDevBits then @subviews.inventory_view else @subviews.choose_hero_view).$el.addClass 'active'
|
(if @options.showInventory then @subviews.inventory_view else @subviews.choose_hero_view).$el.addClass 'active'
|
||||||
|
|
||||||
onHidden: ->
|
onHidden: ->
|
||||||
subview.onHidden?() for subviewKey, subview of @subviews
|
subview.onHidden?() for subviewKey, subview of @subviews
|
||||||
|
|
Reference in a new issue