diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-03-19 15:55:04 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:19 +0200 |
commit | 8a0f60cf4607f50af67833f31d6a21cd021581db (patch) | |
tree | d9da9be62725e5e6f1711cd5b7258d5fbeefdd31 /install/ui/src/freeipa/Application_controller.js | |
parent | 89635f1bc356bb9146c73e25530872e15e6acfec (diff) | |
download | freeipa-8a0f60cf4607f50af67833f31d6a21cd021581db.tar.gz freeipa-8a0f60cf4607f50af67833f31d6a21cd021581db.tar.xz freeipa-8a0f60cf4607f50af67833f31d6a21cd021581db.zip |
Add handling of runtime and shutdown phase. App-init renamed to init.
https://fedorahosted.org/freeipa/ticket/3236
Diffstat (limited to 'install/ui/src/freeipa/Application_controller.js')
-rw-r--r-- | install/ui/src/freeipa/Application_controller.js | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js index 03b987a1f..d9f3129c8 100644 --- a/install/ui/src/freeipa/Application_controller.js +++ b/install/ui/src/freeipa/Application_controller.js @@ -27,6 +27,7 @@ define(['dojo/_base/declare', 'dojo/_base/lang', 'dojo/_base/array', + 'dojo/Deferred', 'dojo/on', 'dojo/topic', 'dojo/query', @@ -37,7 +38,7 @@ define(['dojo/_base/declare', './navigation/Router', './navigation/menu_spec' ], - function(declare, lang, array, on, topic, query, dom_class, + function(declare, lang, array, Deferred, on, topic, query, dom_class, App_widget, IPA, Menu, Router, menu_spec) { /** @@ -113,6 +114,10 @@ define(['dojo/_base/declare', this.app_widget.menu_widget.ignore_changes = false; this.app_widget.menu_widget.render(); this.app_widget.menu_widget.select(this.menu.selected); + }, + + start_runtime: function() { + this.run_time = new Deferred(); // now we are ready for displaying a facet // cat match a facet if hash is set @@ -120,12 +125,18 @@ define(['dojo/_base/declare', // choose default facet if not defined by route if (!this.current_facet) { - if (selfservice) { + if (IPA.is_selfservice) { this.on_profile(); } else { this.router.navigate_to_entity_facet('user', 'search'); } } + + return this.run_time.promise; + }, + + start_logout: function() { + IPA.logout(); }, is_selfservice: function() { @@ -162,7 +173,7 @@ define(['dojo/_base/declare', }, on_logout: function(event) { - IPA.logout(); + this.run_time.resolve(); }, on_phase_error: function(error) { |