Skip to content

Commit

Permalink
Merge pull request #190 from shankari/release_v160
Browse files Browse the repository at this point in the history
Restore a cancel button to the actionsheet
  • Loading branch information
shankari authored Dec 1, 2016
2 parents 08b4dcb + bc4b4c8 commit a75d4fe
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions www/js/incident/post-trip-manual.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,14 @@ angular.module('emission.incident.posttrip.manual', ['emission.plugin.logger',
var safe_suck_cancel_actions = [{text: "Safe",
action: addSafeEntry},
{text: "Suck",
action: addSuckEntry}]
action: addSuckEntry},
{text: "Cancel",
action: cancelTempEntry}]

$ionicActionSheet.show({titleText: "lat: "+latlng.lat.toFixed(6)
+", lng: " + latlng.lng.toFixed(6)
+ " at " + getFormattedTime(ts),
cancelText: 'Cancel',
// cancelText: 'Cancel',
cancel: function() {
cancelTempEntry(latlng, ts, marker, e, map);
},
Expand All @@ -223,10 +225,12 @@ angular.module('emission.incident.posttrip.manual', ['emission.plugin.logger',
* it will look like the incident is deleted until we refresh the trip
* information by pulling to refresh. So let's add to the geojson as well.
*/
var newFeature = ptmm.toGeoJSONFeature(newEntry);
featureArray.push(newFeature);
// And one that is done, let's remove the temporary marker
cancelTempEntry(latlng, ts, marker, e, map);
if (button.text != "Cancel") {
var newFeature = ptmm.toGeoJSONFeature(newEntry);
featureArray.push(newFeature);
// And one that is done, let's remove the temporary marker
cancelTempEntry(latlng, ts, marker, e, map);
}
return true;
}
});
Expand Down

0 comments on commit a75d4fe

Please sign in to comment.