mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-13 22:49:51 -04:00
Turning some links into buttons for iPad.
This commit is contained in:
parent
441cf8c339
commit
447432301d
3 changed files with 13 additions and 5 deletions
|
@ -44,7 +44,7 @@ block modal-body-content
|
|||
.next-levels-prompt
|
||||
for button in continueButtons
|
||||
- var enabled = Boolean(button.link != '/play' || me.getBranchingGroup() == 'choice-implicit' || button.key == 'continue');
|
||||
a.btn.btn-success.btn-lg.world-map-button.next-level-branch-button(href=button.link, disabled=!enabled, data-dismiss="modal", data-i18n="play_level.victory_play_" + button[me.getBranchingGroup()], data-branch-key=button.key)
|
||||
button.btn.btn-success.btn-lg.world-map-button.next-level-branch-button(data-href=button.link, disabled=!enabled, data-dismiss="modal", data-i18n="play_level.victory_play_" + button[me.getBranchingGroup()], data-branch-key=button.key)
|
||||
|
||||
block modal-footer-content
|
||||
if me.get('anonymous')
|
||||
|
@ -65,6 +65,6 @@ block modal-footer-content
|
|||
if readyToRank
|
||||
.ladder-submission-view
|
||||
else if level.get('type') === 'hero-ladder'
|
||||
a.btn.btn-primary(href="/play/ladder/#{level.get('slug')}#my-matches", data-dismiss="modal", data-i18n="play_level.victory_return_to_ladder") Return to Ladder
|
||||
button.btn.btn-primary.return-to-ladder-button(data-href="/play/ladder/#{level.get('slug')}#my-matches", data-dismiss="modal", data-i18n="play_level.victory_return_to_ladder") Return to Ladder
|
||||
else
|
||||
button.btn.btn-success.world-map-button.next-level-button.hide#continue-button(data-i18n="play_level.victory_play_continue") Continue
|
||||
|
|
|
@ -76,7 +76,7 @@ module.exports = class DiplomatView extends ContributeClassView
|
|||
bg: [] # български език, Bulgarian
|
||||
no: ['bardeh', 'torehaug'] # Norsk, Norwegian
|
||||
nn: [] # Norwegian (Nynorsk), Norwegian Nynorsk
|
||||
nb: [] # Norsk Bokmål, Norwegian (Bokmål)
|
||||
nb: ['mcclane654'] # Norsk Bokmål, Norwegian (Bokmål)
|
||||
he: ['OverProgram', 'monetita'] # עברית, Hebrew
|
||||
lt: [] # lietuvių kalba, Lithuanian
|
||||
sr: [] # српски, Serbian
|
||||
|
|
|
@ -21,6 +21,7 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
events:
|
||||
'click #continue-button': 'onClickContinue'
|
||||
'click .next-level-branch-button': 'onClickNextLevelBranch'
|
||||
'click .return-to-ladder-button': 'onClickReturnToLadder'
|
||||
|
||||
constructor: (options) ->
|
||||
super(options)
|
||||
|
@ -298,7 +299,14 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
|
||||
onClickNextLevelBranch: (e) ->
|
||||
e.preventDefault()
|
||||
application.tracker?.trackEvent 'Branch Selected', level: @level.get('slug'), label: @level.get('slug'), branch: $(e.target).data('branch-key'), branchingGroup: me.getBranchingGroup()
|
||||
route = $(e.target).data('href') or "/play/#{@getNextLevelMap()}"
|
||||
application.tracker?.trackEvent 'Branch Selected', level: @level.get('slug'), label: @level.get('slug'), branch: $(e.target).data('branch-key'), branchingGroup: me.getBranchingGroup(), route: route
|
||||
# Preserve the supermodel as we navigate back to world map.
|
||||
route = $(e.target).attr('href') or "/play/#{@getNextLevelMap()}"
|
||||
console.log 'would navigate to', route
|
||||
Backbone.Mediator.publish 'router:navigate', route: route, viewClass: require('views/play/WorldMapView'), viewArgs: [{supermodel: @supermodel}, @getNextLevelMap()]
|
||||
|
||||
onClickReturnToLadder: (e) ->
|
||||
e.preventDefault()
|
||||
route = $(e.target).data('href')
|
||||
# Preserve the supermodel as we navigate back to the ladder.
|
||||
Backbone.Mediator.publish 'router:navigate', route: route, viewClass: require('views/play/ladder/LadderView'), viewArgs: [{supermodel: @supermodel}, @level.get('slug')]
|
||||
|
|
Loading…
Reference in a new issue