Commit 5e48f328 authored by Taddeus Kroes's avatar Taddeus Kroes

Added default image height/width ratio to prevent sudden shift of details window on image load

parent 1ce0515e
...@@ -227,6 +227,7 @@ ProgramDetailsView = Backbone.View.extend( ...@@ -227,6 +227,7 @@ ProgramDetailsView = Backbone.View.extend(
@alignMiddle() @alignMiddle()
# Align again after images are loaded # Align again after images are loaded
@$('.content img').load(-> $(@).css(height: 'auto'))
@$('.content img').load(=> @alignMiddle()) @$('.content img').load(=> @alignMiddle())
) )
else else
......
...@@ -254,6 +254,7 @@ $loader-size: 66px ...@@ -254,6 +254,7 @@ $loader-size: 66px
$details-width: 500px $details-width: 500px
$details-initial-offset: 150px $details-initial-offset: 150px
$img-ratio: 310px / 550px
.program-details .content .program-details .content
position: absolute position: absolute
...@@ -272,6 +273,11 @@ $details-initial-offset: 150px ...@@ -272,6 +273,11 @@ $details-initial-offset: 150px
* *
max-width: $details-width max-width: $details-width
// Set default image height, to be overwritten with 'auto' when the image
// is loaded. This prevents a shift of the details window on image load.
img
height: $details-width * $img-ratio
.properties .properties
padding-left: 15px padding-left: 15px
margin-top: 1px margin-top: 1px
......
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