mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-28 13:50:07 -04:00
More improvements to level loading view sizing and unveiling.
This commit is contained in:
parent
1b94868197
commit
8d81445b84
1 changed files with 4 additions and 5 deletions
|
@ -27,12 +27,12 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
_.defer =>
|
||||
return if @destroyed
|
||||
# Make sure that we are as tall now as we will be when the canvas wrapper is resized to the right height.
|
||||
currentCanvasHeight = 589
|
||||
canvasAspectRatio = 924 / 589
|
||||
eventualCanvasWidth = $('#canvas-wrapper').outerWidth()
|
||||
eventualCanvasHeight = Math.max(eventualCanvasWidth / canvasAspectRatio)
|
||||
currentCanvasHeight = 589
|
||||
extraHeight = 50 # From control bar (I think)
|
||||
@$el.addClass('manually-sized').css('height', @$el.outerHeight() + eventualCanvasHeight - currentCanvasHeight + 2 + extraHeight)
|
||||
eventualCanvasHeight = eventualCanvasWidth / canvasAspectRatio
|
||||
newHeight = Math.max 769, @$el.outerHeight() + eventualCanvasHeight - currentCanvasHeight + 2
|
||||
@$el.addClass('manually-sized').css('height', newHeight)
|
||||
|
||||
onLevelLoaded: (e) ->
|
||||
@level = e.level
|
||||
|
@ -64,7 +64,6 @@ module.exports = class LevelLoadingView extends CocoView
|
|||
Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'level_loaded', volume: 0.75 # old: loading_ready
|
||||
@$el.find('.progress').addClass 'active progress-striped'
|
||||
@$el.find('.start-level-button').removeClass 'secret'
|
||||
@$el.removeClass('manually-sized').css('height', '100%')
|
||||
|
||||
startUnveiling: (e) ->
|
||||
Backbone.Mediator.publish 'level:loading-view-unveiling', {}
|
||||
|
|
Loading…
Add table
Reference in a new issue