We use this functionality in system preferences and in advanced cataloguing editor. It would be nice to have it on patron form too.
Created attachment 90526 [details] [review] Bug 23100: Add leave page confirmation to patron edit form Test plan: 1) Apply the patch 2) Try to edit a patron, change some value and try to go out without saving, you should be notified you have unsaved changes
This patch seems to be working well and I think it's a good idea. However, the custom message doesn't appear for me in Firefox or Chrome. Is this expected? Is there a browser which will show the message defined in the template?
Created attachment 90617 [details] [review] Bug 23100: Add leave page confirmation to patron edit form Test plan: 1) Apply the patch 2) Try to edit a patron, change some value and try to go out without saving, you should be notified you have unsaved changes For me,it works on chrome and firefox Signed-off-by: Bin Wen <bin.wen@inlibro.com>
I've tried it in Firefox and Chrome, while both times I am asked for confirmation before leaving the page, it always shows the default message from the browser instead of the custom one. Josef, can you have a look? I might also change it to: You have modified this patron record, ... or You have made a change to this patron record... or similar.
Looks like the parts of this patch related to adding a custom message can be removed: https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload#Browser_compatibility
Hi Josef, do you have time for a follow-up with the change Owen suggested?
Still a good idea, I think. Maybe someone would like to adopt?