Description
Nick Clemens
2017-09-07 09:40:24 UTC
Created attachment 66911 [details] [review] Bug 19267: Rancor - Warn before leaving page if record modified To test: 1 - Open the advanced editor 2 - Make some changes to a record 3 - Click on 'Patrons' or leave the page in some way 4 - Note there is no warning and changes are not saved 5 - Apply patch 6 - Open the advanced editor 7 - Make some changes 8 - Leave the page 9 - Note you get a warning of unsaved changes and can stay on the page Created attachment 67274 [details] [review] Bug 19267: Rancor - Warn before leaving page if record modified To test: 1 - Open the advanced editor 2 - Make some changes to a record 3 - Click on 'Patrons' or leave the page in some way 4 - Note there is no warning and changes are not saved 5 - Apply patch 6 - Open the advanced editor 7 - Make some changes 8 - Leave the page 9 - Note you get a warning of unsaved changes and can stay on the page Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Sorry, but this is wrong. You need to return 'undefined' in case there are no changes, this patch just fires the question dialog everytime. See this page for more: https://stackoverflow.com/questions/7317273/warn-user-before-leaving-web-page-with-unsaved-changes We could also consider to add this functionality to all Koha pages (or almost all) through some existing plugin like http://plugins.jquery.com/are-you-sure/ but thats definitely out of scope of this bug, as Rancor is a special case. One more thing: You even don't need jquery this should be enough: window.onbeforeunload = function() { ... }; Created attachment 70326 [details] [review] Bug 19267: Followup - only fire if changes and don't use javascript Please, squash the patches and ask for new sign-off, it's completely different code now... Created attachment 72924 [details] [review] Bug 19267: Rancor - Warn before leaving page if record modified To test: 1 - Open the advanced editor 2 - Make some changes to a record 3 - Click on 'Patrons' or leave the page in some way 4 - Note there is no warning and changes are not saved 5 - Apply patch 6 - Open the advanced editor 7 - Make some changes 8 - Leave the page 9 - Note you get a warning of unsaved changes and can stay on the page Created attachment 73505 [details] [review] Bug 19267: Rancor - Warn before leaving page if record modified To test: 1 - Open the advanced editor 2 - Make some changes to a record 3 - Click on 'Patrons' or leave the page in some way 4 - Note there is no warning and changes are not saved 5 - Apply patch 6 - Open the advanced editor 7 - Make some changes 8 - Leave the page 9 - Note you get a warning of unsaved changes and can stay on the page Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Created attachment 73609 [details] [review] Bug 19267: Rancor - Warn before leaving page if record modified To test: 1 - Open the advanced editor 2 - Make some changes to a record 3 - Click on 'Patrons' or leave the page in some way 4 - Note there is no warning and changes are not saved 5 - Apply patch 6 - Open the advanced editor 7 - Make some changes 8 - Leave the page 9 - Note you get a warning of unsaved changes and can stay on the page Signed-off-by: Charles Farmer <charles.farmer@inLibro.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Pushed to master for 18.05, thanks to everybody involved! Pushed to stable for 17.11.06 Awesome work all! Pushed to 17.05.x for v17.05.12 |