Skip to content

Commit

Permalink
Close the Revisited Modals when user hits done button, only if a phot…
Browse files Browse the repository at this point in the history
…o has been taken.
  • Loading branch information
kblairwhite committed Jun 22, 2014
1 parent 6c55ee8 commit 476cdf4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/controllers/plotsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,19 @@ function saveEdit(e){
}
}catch(e){
Ti.API.error(e.toString());
}finally{
//Close the database
db.close();
//close the window when user hits done button if a photo has been taken.
if(photo != null){
//remove the temp photo - used for photo preview
var tempPhoto = Ti.Filesystem.getFile(Titanium.Filesystem.tempDirectory,'temp.png');
if(tempPhoto.exists){
tempPhoto.deleteFile();
}
Ti.App.fireEvent("app:refreshPlots");
$.modalNav.close();
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions app/controllers/transectsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,16 @@ function saveEdit(e){
Ti.App.fireEvent("app:dataBaseError", {error: errorMessage});
} finally {
db.close();
//close the window when user hits done button if a photo has been taken.
if(photo != null){
//remove the temp photo - used for photo preview //Ti.Filesystem.tempDirectory
var tempPhoto = Ti.Filesystem.getFile(Titanium.Filesystem.tempDirectory,'temp.png');
if(tempPhoto.exists){
tempPhoto.deleteFile();
}
Ti.App.fireEvent("app:refreshTransects");
$.modalNav.close();
}
}
}

Expand Down

0 comments on commit 476cdf4

Please sign in to comment.