From c53831037cbe388d961420e87b036b1caf6cf723 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Thu, 30 Sep 2010 15:37:33 -0500 Subject: Refactoring navigation.js. The navigation.js has been modified to make it more abstract, i.e. unaware of entity facets. The nav_update_tabs() has been modified such that it activates and updates the tabs based on the current state stored in the URL. The facets are now handled in entity.js. The ipa_entity_setup() has been modified to update the facets based on the current state and cached state. The navigation.js also has been modified to be more class-like. The nav_create() has been modified to store the tab configuration and the tab container in internal variables nav_tabs_lists and nav_container. The nav_update_tabs() now can be called without any parameters. Functions nav_push_state(), nav_get_state(), and nav_remove_state() have been added to wrap BBQ API. This is to allow unit tests to replace them with mockup functions to remove dependency on BBQ. --- install/static/test/navigation_tests.js | 98 ++++++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 9 deletions(-) (limited to 'install/static/test/navigation_tests.js') diff --git a/install/static/test/navigation_tests.js b/install/static/test/navigation_tests.js index 4144e81a..318ac664 100644 --- a/install/static/test/navigation_tests.js +++ b/install/static/test/navigation_tests.js @@ -27,7 +27,7 @@ test("Testing nav_create().", function() { [ { name:'identity', label:'IDENTITY', children: [ {name:'user', label:'Users', setup:mock_setup_user}, - {name:'group', label:'Users', setup:mock_setup_group}, + {name:'group', label:'Users', setup:mock_setup_group} ]}]; function mock_setup_user (jobj){ user_mock_called = true; @@ -44,7 +44,7 @@ test("Testing nav_create().", function() { var navigation = $('