|
@@ -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
|
|
|
|
|
- top = @$('.content').outerHeight() / 2
|
|
|
|
|
- @$('.content').css(marginTop: "-#{top}px")
|
|
|
|
|
|
|
+ # Align again after images are loaded
|
|
|
|
|
+ @$('.content img').load(=> @alignMiddle())
|
|
|
)
|
|
)
|
|
|
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(
|