Skip to content
This repository was archived by the owner on Jul 5, 2018. It is now read-only.

Commit ed0d0cf

Browse files
committed
Attempt to clear memory by dropping old large preview images before going to the camera.
1 parent ede112b commit ed0d0cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

assets/www/js/app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,9 @@ require( [ 'jquery', 'l10n', 'geo', 'api', 'templates', 'monuments', 'monument',
10541054

10551055
// upload-page
10561056
$('#takephoto').click(function() {
1057+
// Attempt to clear memory from giant image preview of prior image
1058+
$( 'img.preview-image' ).removeAttr( 'src' );
1059+
10571060
navigator.camera.getPicture(function(data) {
10581061
// success
10591062
state.fileUri = data;
@@ -1069,6 +1072,9 @@ require( [ 'jquery', 'l10n', 'geo', 'api', 'templates', 'monuments', 'monument',
10691072
});
10701073
});
10711074
$('#selectphoto').click(function() {
1075+
// Attempt to clear memory from giant image preview of prior image
1076+
$( 'img.preview-image' ).removeAttr( 'src' );
1077+
10721078
navigator.camera.getPicture(function(data) {
10731079
// success
10741080
state.fileUri = data;

0 commit comments

Comments
 (0)