Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug1088051 - Fix of stuck in image edit window on clicking edit icon …
Browse files Browse the repository at this point in the history
…immediately after image delete r=djf

Conflicts:
	apps/gallery/js/ImageEditor.js
  • Loading branch information
punamdahiya authored and rvandermeulen committed Nov 4, 2014
1 parent 2fd5ba5 commit 16b4226
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 10 additions & 3 deletions apps/gallery/js/ImageEditor.js
Expand Up @@ -346,9 +346,11 @@ function exitEditMode(saved) {
URL.revokeObjectURL(editedPhotoURL);
editedPhotoURL = null;

// close the editor object
imageEditor.destroy();
imageEditor = null;
// Check for imageEditor and close the editor object
if (imageEditor) {
imageEditor.destroy();
imageEditor = null;
}

window.removeEventListener('resize', resizeHandler);

Expand Down Expand Up @@ -395,6 +397,11 @@ function saveEditedImage() {
// save operations
$('edit-save-button').disabled = true;

// Check for imageEditor before continuing with save
if (!imageEditor) {
return;
}

// If we are in crop mode, perform the crop before saving
if ($('edit-crop-button').classList.contains('selected'))
imageEditor.cropImage();
Expand Down
4 changes: 3 additions & 1 deletion apps/gallery/js/frames.js
Expand Up @@ -137,9 +137,11 @@ function deleteSingleItem() {
confirmText: navigator.mozL10n.get('delete'),
danger: true
}, function() { // onSuccess
// disable delete and share button to prevent operations while delete item
// disable delete, edit and share button to prevent
// operations while delete item
fullscreenButtons.delete.classList.add('disabled');
fullscreenButtons.share.classList.add('disabled');
fullscreenButtons.edit.classList.add('disabled');

deleteFile(currentFileIndex);
// Enable NFC sharing when done deleting and returns to fullscreen view
Expand Down

0 comments on commit 16b4226

Please sign in to comment.