mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
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
|
@ -8,8 +8,9 @@ block modal-body-content
|
|||
- if (!showDevBits) { // Not done yet.
|
||||
- submenus.splice(4, 1);
|
||||
- submenus.splice(2, 1);
|
||||
- submenus.splice(0, 1);
|
||||
- }
|
||||
- if (!showInventory)
|
||||
- submenus.splice(0, 1);
|
||||
ul.nav.nav-tabs
|
||||
for submenu, index in submenus
|
||||
li(class=index ? "" : "active")
|
||||
|
@ -19,10 +20,6 @@ block modal-body-content
|
|||
.tab-content
|
||||
for submenu, index in submenus
|
||||
.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
|
||||
|
||||
block modal-footer
|
|
@ -18,6 +18,7 @@ module.exports = class GameMenuModal extends ModalView
|
|||
constructor: (options) ->
|
||||
super options
|
||||
@options.showDevBits = me.isAdmin() or /https?:\/\/localhost/.test(window.location.href)
|
||||
@options.showInventory = @options.level.get('type', true) is 'hero'
|
||||
|
||||
events:
|
||||
'change input.select': 'onSelectionChanged'
|
||||
|
@ -25,13 +26,14 @@ module.exports = class GameMenuModal extends ModalView
|
|||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
context.showDevBits = @options.showDevBits
|
||||
context.showInventory = @options.showInventory
|
||||
context
|
||||
|
||||
afterRender: ->
|
||||
super()
|
||||
@$el.toggleClas
|
||||
@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: ->
|
||||
subview.onHidden?() for subviewKey, subview of @subviews
|
||||
|
|
Loading…
Reference in a new issue