From 4b2d20a1f95edd2982fbb1901287f2bb2194c9db Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Tue, 20 May 2014 12:57:28 +0200 Subject: webui: display only dialogs which belong to current facet Dialog instances no longer directly call IPA.opened_dialog methods. It's handled through events (decoupled from dialog's POV). IPA.open_dialogs with assistance of ApplicationController makes sure that there is only one dialog opened at the same time. It also makes sure to hide all dialogs, which are not global dialogs and did not originate from current facet, when switching facets. https://fedorahosted.org/freeipa/ticket/4348 Reviewed-By: Endi Sukma Dewata --- install/ui/src/freeipa/Application_controller.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'install/ui/src/freeipa/Application_controller.js') diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js index c166e36ee..f38a60dc3 100644 --- a/install/ui/src/freeipa/Application_controller.js +++ b/install/ui/src/freeipa/Application_controller.js @@ -116,6 +116,7 @@ define([ simple_container.hide(); var load_facet = reg.facet.get('load'); this.show_facet(load_facet); + IPA.opened_dialogs.start_handling(this); }, /** @@ -320,9 +321,14 @@ define([ on(facet, 'facet-state-change', lang.hitch(this, this.on_facet_state_changed)); } + if (this.current_facet !== facet) { + IPA.opened_dialogs.hide(); + } + this.hide_facet(); this.current_facet = facet; facet.show(); + IPA.opened_dialogs.focus_top(); }, hide_facet: function() { @@ -455,7 +461,6 @@ define([ } topic.publish('auth-successful'); }); - this.show_facet(login_facet); } } -- cgit