diff options
author | Struan Donald <struan@exo.org.uk> | 2013-08-06 17:23:09 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2013-08-06 17:23:09 +0100 |
commit | d418a7de38becda6d892ca62f30792a4416b2218 (patch) | |
tree | 7d03302d3cb29919a2a4e2559b70dea00b3d159c | |
parent | 581be21f71cb952436cb36380eac9c5f94126e88 (diff) |
Improve feel of photo adding screen
Now we hide the placeholder image to stop jerky resizing
Also display a busy indicator so the user knows something is happening
Fixes #83 after a fashion.
-rw-r--r-- | src/js/views/photo.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/js/views/photo.js b/src/js/views/photo.js index 7acef6c..1544254 100644 --- a/src/js/views/photo.js +++ b/src/js/views/photo.js @@ -29,12 +29,16 @@ takePhoto: function(e) { e.preventDefault(); + $.mobile.loading('show'); + $('#photo').hide(); var that = this; navigator.camera.getPicture( function(imgURI) { that.addPhotoSuccess(imgURI); }, function(error) { that.addPhotoFail(error); }, { saveToPhotoAlbum: true, quality: 49, destinationType: Camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.CAMERA, correctOrientation: true }); }, addPhoto: function(e) { e.preventDefault(); + $.mobile.loading('show'); + $('#photo').hide(); var that = this; navigator.camera.getPicture( function(imgURI) { that.addPhotoSuccess(imgURI); }, function(error) { that.addPhotoFail(error); }, { saveToPhotoAlbum: false, quality: 49, destinationType: Camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY, correctOrientation: true }); }, @@ -65,12 +69,16 @@ $('#id_del_photo_button').parents('.ui-btn').show(); $('#id_photo_button').parents('.ui-btn').hide(); $('#id_existing').parents('.ui-btn').hide(); + $('#photo').show(); + window.setTimeout(function() { $.mobile.loading('hide') }, 100); }); move.fail( function() { that.addPhotoFail(); } ); }, addPhotoFail: function() { + $('#photo').show(); + $.mobile.loading('hide'); if ( message != 'no image selected' && message != 'Selection cancelled.' && message != 'Camera cancelled.' ) { |