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(
$('#loading-screen').hide()
@$el.show()
@$('.content').html(@template(_.extend(id: id, data)))
@alignMiddle()
# Vertically align in middle
top = @$('.content').outerHeight() / 2
@$('.content').css(marginTop: "-#{top}px")
# Align again after images are loaded
@$('.content img').load(=> @alignMiddle())
)
else
@$el.hide()
@$('.content').empty()
alignMiddle: ->
top = @$('.content').outerHeight() / 2
@$('.content').css(marginTop: "-#{top}px")
)
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