change remainder of "confirm" calls to better UX

This commit is contained in:
2024-04-24 20:11:38 -06:00
parent eeaacaf202
commit f4f5fc7730
5 changed files with 169 additions and 119 deletions

View File

@@ -116,7 +116,7 @@
<l-marker
v-if="latitude && longitude"
:lat-lng="[latitude, longitude]"
@click="maybeEraseLatLong()"
@click="confirmEraseLatLong()"
/>
</l-map>
</div>
@@ -451,12 +451,25 @@ export default class NewEditProjectView extends Vue {
}
}
public maybeEraseLatLong() {
if (window.confirm("Are you sure you don't want to mark a location?")) {
this.latitude = 0;
this.longitude = 0;
this.includeLocation = false;
}
confirmEraseLatLong() {
this.$notify(
{
group: "modal",
type: "confirm",
title: "Erase Marker",
text: "Are you sure you don't want to mark a location? This will erase the current location.",
onYes: async () => {
this.eraseLatLong();
},
},
-1,
);
}
public eraseLatLong() {
this.latitude = 0;
this.longitude = 0;
this.includeLocation = false;
}
public onCancelClick() {