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:
Petr Vobornik committed 2013-05-06 16:22:19 +02:00
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;
+2
View File
@@ -520,6 +520,8 @@ IPA.facet = function(spec, no_init) {
facet: that
});
dialog.callback = permit_callback;
return dialog;
};
+1 -3
View File
@@ -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);