diff options
author | Struan Donald <struan@exo.org.uk> | 2013-07-19 11:31:54 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-07-19 11:31:54 +0100 |
commit | 0928b917367850f269197369b7e0d5ada0f01650 (patch) | |
tree | d9a6466a57b861f8dc37095c7946ef4bc15c87bf /src | |
parent | 2a477c0fe37fc6f3b5a53f728f955ad197d24480 (diff) |
avoid distorting photo placeholder image. Fixes #50
Diffstat (limited to 'src')
-rw-r--r-- | src/css/fms.css | 12 | ||||
-rw-r--r-- | src/js/views/photo.js | 4 | ||||
-rw-r--r-- | src/templates/en/photo.html | 2 |
3 files changed, 15 insertions, 3 deletions
diff --git a/src/css/fms.css b/src/css/fms.css index b49a0e0..e536a77 100644 --- a/src/css/fms.css +++ b/src/css/fms.css @@ -703,6 +703,18 @@ max-height: 70%; } + img.placeholder { + height: 199px; + width: 270px; + } + + @media only screen and (max-width: 800px) and (min-width: 600px) { + img.placeholder { + height: 398px; + width: 540px; + } + } + .ui-icon-fms-photo-existing, .ui-icon-fms-photo-new { position: static; diff --git a/src/js/views/photo.js b/src/js/views/photo.js index 6a2b8f6..e3bb489 100644 --- a/src/js/views/photo.js +++ b/src/js/views/photo.js @@ -57,7 +57,7 @@ var that = this; move.done( function( file ) { - $('#photo').attr('src', file.toURL()); + $('#photo').attr('src', file.toURL()).addClass('small').removeClass('placeholder'); that.model.set('file', file.toURL()); FMS.saveCurrentDraft(); @@ -86,7 +86,7 @@ del.done( function() { that.model.set('file', ''); FMS.saveCurrentDraft(); - $('#photo').attr('src', 'images/placeholder-photo.png'); + $('#photo').attr('src', 'images/placeholder-photo.png').addClass('placeholder').removeClass('small'); $('#photo-next-btn .ui-btn-text').text('Skip'); $('#id_del_photo_button').parents('.ui-btn').hide(); diff --git a/src/templates/en/photo.html b/src/templates/en/photo.html index 6e69c4c..d986a15 100644 --- a/src/templates/en/photo.html +++ b/src/templates/en/photo.html @@ -10,7 +10,7 @@ <h2>Add a Photo <em>(optional)</em>:</h2> <div class="photo"> <% if ( file == '' ) { %> - <img class="small" src="images/placeholder-photo.png" alt="" id="photo"> + <img class="placeholder" src="images/placeholder-photo.png" alt="" id="photo"> <% } else { %> <img class="small" id="photo" src="<%= file %>" /> <% } %> |