Fix for bug.

This commit is contained in:
kvasnyk 2014-03-18 05:47:53 +01:00
parent 8276dbf2d1
commit 5216432bf9
3 changed files with 16 additions and 4 deletions
app
styles/editor/level
templates/editor/level
views/editor/level

View file

@ -75,13 +75,14 @@
right: 0 right: 0
top: 0 top: 0
bottom: 0 bottom: 0
#thangs-list #thangs-list
position: absolute position: relative
right: 0 right: 0
top: 40px top: 0
bottom: 0 bottom: 0
overflow: scroll overflow: scroll
height: 100%
h3 h3
margin: 0 -20px 0 0 margin: 0 -20px 0 0

View file

@ -22,7 +22,8 @@
#canvas-top-gradient.gradient #canvas-top-gradient.gradient
.add-thangs-palette.thangs-column .add-thangs-palette.thangs-column
h3(data-i18n="editor.level_tab_thangs_add") Add Thangs #thangs-header
h3(data-i18n="editor.level_tab_thangs_add") Add Thangs
#thangs-list #thangs-list
for group in groups for group in groups
h4= group.name h4= group.name

View file

@ -90,12 +90,19 @@ module.exports = class ThangsTabView extends View
context.groups = groups context.groups = groups
context context
onWindowResize: (e) ->
$('#thangs-list').height('100%')
thangsHeaderHeight = $('#thangs-header').height()
oldHeight = $('#thangs-list').height()
$('#thangs-list').height(oldHeight - thangsHeaderHeight)
afterRender: -> afterRender: ->
return if @startsLoading return if @startsLoading
super() super()
$('.tab-content').click @selectAddThang $('.tab-content').click @selectAddThang
$('#thangs-list').bind 'mousewheel', @preventBodyScrollingInThangList $('#thangs-list').bind 'mousewheel', @preventBodyScrollingInThangList
@$el.find('#extant-thangs-filter button:first').button('toggle') @$el.find('#extant-thangs-filter button:first').button('toggle')
$(window).resize @onWindowResize
onFilterExtantThangs: (e) -> onFilterExtantThangs: (e) ->
@$el.find('#extant-thangs-filter button.active').button('toggle') @$el.find('#extant-thangs-filter button.active').button('toggle')
@ -131,6 +138,9 @@ module.exports = class ThangsTabView extends View
@thangsTreema.open() @thangsTreema.open()
@onThangsChanged() # Initialize the World with Thangs @onThangsChanged() # Initialize the World with Thangs
@initSurface() @initSurface()
thangsHeaderHeight = $('#thangs-header').height()
oldHeight = $('#thangs-list').height()
$('#thangs-list').height(oldHeight - thangsHeaderHeight)
initSurface: -> initSurface: ->
surfaceCanvas = $('canvas#surface', @$el) surfaceCanvas = $('canvas#surface', @$el)