[openstreetmap/openstreetmap-website] Add unsaved changes warning to message and diary forms (PR #7076)
Nam Pham
notifications at github.com
Mon May 11 09:07:33 UTC 2026
@phanq003 commented on this pull request.
> @@ -0,0 +1,48 @@
+(function () {
+ function beforeUnloadListener(event) {
+ event.preventDefault();
+ // Legacy support for older browsers.
+ event.returnValue = true;
+ };
+
+ // A function that adds a `beforeunload` listener if there are unsaved changes.
that comment specifically comes from the google chrome reference i used, the comments were mostly more for me than the codebase to be honest, it seems like the norm for this repo is no comments. What would be the best course of action (e.g. delete or change to jsdoc)
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7076#discussion_r3217581139
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7076/review/4262114294 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260511/820d1298/attachment.htm>
More information about the rails-dev
mailing list