mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-04 01:43:40 -04:00
fixed spell palette sliding behind HUD
This commit is contained in:
parent
72c1bb28b3
commit
4f6ca5335f
2 changed files with 20 additions and 1 deletions
app
|
@ -42,7 +42,6 @@ body.is-playing
|
||||||
position: fixed
|
position: fixed
|
||||||
width: 100%
|
width: 100%
|
||||||
height: 100%
|
height: 100%
|
||||||
z-index: 20
|
|
||||||
|
|
||||||
#pointer
|
#pointer
|
||||||
position: absolute
|
position: absolute
|
||||||
|
|
|
@ -34,6 +34,7 @@ module.exports = class SpellListTabEntryView extends SpellListEntryView
|
||||||
afterRender: ->
|
afterRender: ->
|
||||||
super()
|
super()
|
||||||
@$el.addClass 'spell-tab'
|
@$el.addClass 'spell-tab'
|
||||||
|
@attachTransitionEventListener()
|
||||||
|
|
||||||
onNewWorld: (e) ->
|
onNewWorld: (e) ->
|
||||||
@thang = e.world.thangMap[@thang.id] if @thang
|
@thang = e.world.thangMap[@thang.id] if @thang
|
||||||
|
@ -94,6 +95,8 @@ module.exports = class SpellListTabEntryView extends SpellListEntryView
|
||||||
Backbone.Mediator.publish 'spell-beautify', spell: @spell
|
Backbone.Mediator.publish 'spell-beautify', spell: @spell
|
||||||
|
|
||||||
onFullscreenClick: ->
|
onFullscreenClick: ->
|
||||||
|
$codearea = $('#code-area')
|
||||||
|
$codearea.css 'z-index', 20 unless $codearea.hasClass 'fullscreen-editor'
|
||||||
$('#code-area').toggleClass 'fullscreen-editor'
|
$('#code-area').toggleClass 'fullscreen-editor'
|
||||||
$('.fullscreen-code').toggleClass 'maximized'
|
$('.fullscreen-code').toggleClass 'maximized'
|
||||||
|
|
||||||
|
@ -134,6 +137,23 @@ module.exports = class SpellListTabEntryView extends SpellListEntryView
|
||||||
filters.revertImage background, '.spell-list-entry-view.spell-tab' if @controlsEnabled
|
filters.revertImage background, '.spell-list-entry-view.spell-tab' if @controlsEnabled
|
||||||
filters.darkenImage background, '.spell-list-entry-view.spell-tab', 0.8 unless @controlsEnabled
|
filters.darkenImage background, '.spell-list-entry-view.spell-tab', 0.8 unless @controlsEnabled
|
||||||
|
|
||||||
|
attachTransitionEventListener: =>
|
||||||
|
transitionListener = ''
|
||||||
|
testEl = document.createElement 'fakeelement'
|
||||||
|
transitions =
|
||||||
|
'transition':'transitionend'
|
||||||
|
'OTransition':'oTransitionEnd'
|
||||||
|
'MozTransition':'transitionend'
|
||||||
|
'WebkitTransition':'webkitTransitionEnd'
|
||||||
|
for transition, transitionEvent of transitions
|
||||||
|
unless testEl.style[transition] is undefined
|
||||||
|
transitionListener = transitionEvent
|
||||||
|
break
|
||||||
|
$codearea = $('#code-area')
|
||||||
|
$codearea.on transitionListener, =>
|
||||||
|
$codearea.css 'z-index', 1 unless $codearea.hasClass 'fullscreen-editor'
|
||||||
|
|
||||||
|
|
||||||
destroy: ->
|
destroy: ->
|
||||||
@avatar?.destroy()
|
@avatar?.destroy()
|
||||||
@$el.find('code').popover 'destroy'
|
@$el.find('code').popover 'destroy'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue