diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-03-19 15:29:58 +0100 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-03-27 12:44:40 +0100 |
commit | e7bfac1e63360993aea2be91082ca69c478f3cf1 (patch) | |
tree | c5e1d2161fd27498f9faadf6c9fb651159a7e061 /install/ui/src/freeipa/navigation.js | |
parent | e04da74626dbaef9990833cf1def23da51981a93 (diff) | |
download | freeipa-e7bfac1e63360993aea2be91082ca69c478f3cf1.tar.gz freeipa-e7bfac1e63360993aea2be91082ca69c478f3cf1.tar.xz freeipa-e7bfac1e63360993aea2be91082ca69c478f3cf1.zip |
webui: make navigation module independent on app module
When some module used 'freeipa/navigation' it pulled the entire Web UI
because navigation depended on app.
This patch splits the app into two modules: app and app_container.
App specifies the entities which are part of final application.
app_container module represents the application boot classes. Navigation
now depends on app_container.
Reviewed-By: Adam Misnyovszki <amisnyov@redhat.com>
Diffstat (limited to 'install/ui/src/freeipa/navigation.js')
-rw-r--r-- | install/ui/src/freeipa/navigation.js | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/install/ui/src/freeipa/navigation.js b/install/ui/src/freeipa/navigation.js index 8b96d6f97..ef0a0bf3f 100644 --- a/install/ui/src/freeipa/navigation.js +++ b/install/ui/src/freeipa/navigation.js @@ -21,17 +21,17 @@ define([ 'dojo/_base/lang', - './app', // creates circular dependency - './ipa', - 'exports' // for handling circular dependency + './app_container', + './ipa' ], - function(lang, app, IPA, exports) { + function(lang, app_container, IPA) { var get_router = function() { - return app.app.router; - }, + return app_container.app.router; + }; + var navigation = { /** * Navigation tells application to show certain facet. * @@ -53,7 +53,7 @@ define([ * @param Object params * @param {Object|facet.facet|string|Function} arg */ - set_params = function(params, arg) { + set_params: function(params, arg) { if (lang.isArray(arg)) { params.pkeys = arg; } else if (typeof arg === 'object') { @@ -86,14 +86,14 @@ define([ * @param {Object|facet.facet|string|Function} arg2 * @param {Object|facet.facet|string|Function} arg3 */ - show = function(arg1, arg2, arg3) { + show: function(arg1, arg2, arg3) { var nav = get_router(); var params = {}; - set_params(params, arg1); - set_params(params, arg2); - set_params(params, arg3); + this.set_params(params, arg1); + this.set_params(params, arg2); + this.set_params(params, arg3); var facet = params.facet; @@ -129,13 +129,13 @@ define([ * @param {Object|facet.facet|string|Function} arg2 * @param {Object|facet.facet|string|Function} arg3 */ - show_entity = function(entity_name, arg1, arg2, arg3) { + show_entity: function(entity_name, arg1, arg2, arg3) { var nav = get_router(); var params = {}; - set_params(params, arg1); - set_params(params, arg2); - set_params(params, arg3); + this.set_params(params, arg1); + this.set_params(params, arg2); + this.set_params(params, arg3); return nav.navigate_to_entity_facet(entity_name, params.facet, params.pkeys, params.args); }, @@ -144,17 +144,10 @@ define([ * Show default facet * @method show_default */ - show_default = function() { + show_default: function() { // TODO: make configurable - return show_entity('user', 'search'); - }; - - // Module export - exports = { - show: show, - show_entity: show_entity, - show_default: show_default + return this.show_entity('user', 'search'); + } }; - - return exports; + return navigation; }); |