Skip to content

Commit

Permalink
Add confirm dialog to "Sync now"
Browse files Browse the repository at this point in the history
  • Loading branch information
matsbov committed Dec 29, 2024
1 parent 0c7e075 commit a10e8a0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions grails-app/views/gbif/compare.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@
});
$('#sync-now-link').on('click', function() {
var scanUrl = '${grailsApplication.config.getProperty("grails.serverURL")}/ws/gbif/scan/${dataProvider.uid}'
$.getJSON(scanUrl, function(data) {
location.href = '${grailsApplication.config.getProperty("grails.serverURL")}' + data.trackingUrl;
});
if (confirm('This will sync meta data and download datasets from GBIF. Continue?')) {
var scanUrl = '${grailsApplication.config.getProperty("grails.serverURL")}/ws/gbif/scan/${dataProvider.uid}';
$.getJSON(scanUrl, function(data) {
location.href = '${grailsApplication.config.getProperty("grails.serverURL")}' + data.trackingUrl;
});
}
});
});
</script>
Expand Down

0 comments on commit a10e8a0

Please sign in to comment.