Ask confirmation to unload the page
If there are any tabs open, we should ask confirmation to prevent user to loose unsaved data. We should also save the tree state of the menu like it is done on logout. issue6756 review44301002
This commit is contained in:
1 parent
3f09fb349a
commit
2e50b3f8ee
1 file changed
+11
+11
@@ -80,6 +80,17 @@ var Sao = {};
|
||||
})()
|
||||
});
|
||||
|
||||
window.onbeforeunload = function(e) {
|
||||
if (Sao.main_menu_screen) {
|
||||
Sao.main_menu_screen.save_tree_state(true);
|
||||
}
|
||||
if (Sao.Tab.tabs.length) {
|
||||
var dialog = Sao.i18n.gettext("Are your sure to leave?");
|
||||
e.returnValue = dialog;
|
||||
return dialog;
|
||||
}
|
||||
};
|
||||
|
||||
Sao.class_ = function(Parent, props) {
|
||||
var ClassConstructor = function() {
|
||||
if (!(this instanceof ClassConstructor))
|
||||
|
||||
Reference in new issue
Block a user