-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HDX-9420 display alert if user tries to go back to page b
- Loading branch information
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
ckanext-hdx_theme/ckanext/hdx_theme/fanstatic/onboarding/prevent-back-button.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
window.history.pushState({page: 2}, null, null); | ||
|
||
window.onpopstate = function (event) { | ||
if (event) { | ||
var r = confirm('Hold on! Your data has already been saved. Are you sure you want to go back to the previous page and reload the signup process?'); | ||
if (r === true) { | ||
history.back(); | ||
} else { | ||
window.history.pushState({page: 2}, '', ''); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
ckanext-hdx_theme/ckanext/hdx_theme/templates/onboarding/signup/verify-email.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters