Commit 362f4218 authored by Taddeus Kroes's avatar Taddeus Kroes

Details window now aligns again on image load

parent 3342e5d3
...@@ -221,14 +221,18 @@ ProgramDetailsView = Backbone.View.extend( ...@@ -221,14 +221,18 @@ ProgramDetailsView = Backbone.View.extend(
$('#loading-screen').hide() $('#loading-screen').hide()
@$el.show() @$el.show()
@$('.content').html(@template(_.extend(id: id, data))) @$('.content').html(@template(_.extend(id: id, data)))
@alignMiddle()
# Vertically align in middle # Align again after images are loaded
top = @$('.content').outerHeight() / 2 @$('.content img').load(=> @alignMiddle())
@$('.content').css(marginTop: "-#{top}px")
) )
else else
@$el.hide() @$el.hide()
@$('.content').empty() @$('.content').empty()
alignMiddle: ->
top = @$('.content').outerHeight() / 2
@$('.content').css(marginTop: "-#{top}px")
) )
AppView = Backbone.View.extend( AppView = Backbone.View.extend(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment