Replaced hasUnsavedData with beforeunload method.
Authored by: keess 2016-04-08
Parent: [r2879]
Child: [r2881]