Fix dirty dialog behavior
Dirty dialog was displayed twice because of double event registration in menu widget. https://fedorahosted.org/freeipa/ticket/3236
This commit is contained in:
1 parent
b06d008f31
commit
89635f1bc3
3 files changed
+5
-5
No files matched your search
@@ -179,13 +179,13 @@ define(['dojo/_base/declare',
|
||||
var current_facet = this.current_facet;
|
||||
|
||||
if (current_facet && !current_facet.can_leave()) {
|
||||
var permit_clb = function() {
|
||||
var permit_clb = lang.hitch(this, function() {
|
||||
// Some facet's might not call reset before this call but after
|
||||
// so they are still dirty. Calling reset prevent's opening of
|
||||
// dirty dialog again.
|
||||
if (current_facet.is_dirty()) current_facet.reset(); //TODO change
|
||||
this.router.navigate_to_hash(event.hash, event.facet);
|
||||
};
|
||||
});
|
||||
|
||||
var dialog = current_facet.show_leave_dialog(permit_clb);
|
||||
this.router.canceled = true;
|
||||
|
||||
@@ -520,6 +520,8 @@ IPA.facet = function(spec, no_init) {
|
||||
facet: that
|
||||
});
|
||||
|
||||
dialog.callback = permit_callback;
|
||||
|
||||
return dialog;
|
||||
};
|
||||
|
||||
|
||||
@@ -129,9 +129,7 @@ define(['dojo/_base/declare',
|
||||
click: click_handler
|
||||
}, ul_node);
|
||||
|
||||
var a_node = construct.create('a', {
|
||||
click: click_handler
|
||||
}, li_node);
|
||||
var a_node = construct.create('a', {}, li_node);
|
||||
|
||||
this._update_item(menu_item, li_node);
|
||||
|
||||
|
||||
Reference in new issue
Block a user