new UI - empty zonetree when collapse system left menu.

This commit is contained in:
Jessica Wang 2010-10-18 15:09:42 -07:00
parent 32be5f7693
commit 51258656cc
2 changed files with 30 additions and 23 deletions

View File

@ -18,21 +18,7 @@
// Version: @VERSION@
$(document).ready(function() {
function expandFirstLevelMenu($firstLevelMenu, $secondLevelMenu) {
$firstLevelMenu.find("#expandable_first_level_arrow").removeClass("close").addClass("open");
$firstLevelMenu.addClass("highlighted");
$expandedFirstLevelMenu = $firstLevelMenu;
$secondLevelMenu.show();
$expandedSecondLevelMenu = $secondLevelMenu;
}
function collapseFirstLevelMenu($firstLevelMenu, $secondLevelMenu) {
$firstLevelMenu.find("#expandable_first_level_arrow").removeClass("open").addClass("close");
$firstLevelMenu.removeClass("highlighted");
$secondLevelMenu.hide();
}
$(document).ready(function() {
$("#leftmenu_container").find("#expandable_first_level").bind("click", function(event) {
var $firstLevelMenu = $(this);
var $secondLevelMenu = $firstLevelMenu.siblings(".leftmenu_expandedbox");
@ -93,9 +79,7 @@ $(document).ready(function() {
selectLeftMenu($(this));
showMiddleMenuWithoutSearch();
disableMultipleSelectionInMidMenu();
clearLeftMenu();
disableMultipleSelectionInMidMenu();
clearMiddleMenu();
$("#right_panel").load("jsp/domain.jsp", function(){
@ -106,8 +90,7 @@ $(document).ready(function() {
$("#leftmenu_resource").bind("click", function(event) {
showMiddleMenu();
disableMultipleSelectionInMidMenu();
clearLeftMenu();
disableMultipleSelectionInMidMenu();
clearMiddleMenu();
$arrowIcon = $(this).find("#resource_arrow");

View File

@ -470,10 +470,34 @@ function setBooleanField(value, $field) {
$field.hide();
}
function expandFirstLevelMenu($firstLevelMenu, $secondLevelMenu) {
$firstLevelMenu.find("#expandable_first_level_arrow").removeClass("close").addClass("open");
$firstLevelMenu.addClass("highlighted");
$expandedFirstLevelMenu = $firstLevelMenu;
$secondLevelMenu.show();
$expandedSecondLevelMenu = $secondLevelMenu;
}
function collapseFirstLevelMenu($firstLevelMenu, $secondLevelMenu) {
$firstLevelMenu.find("#expandable_first_level_arrow").removeClass("open").addClass("close");
$firstLevelMenu.removeClass("highlighted");
$secondLevelMenu.hide();
}
function clearLeftMenu() {
var $arrowIcon = $("#leftmenu_instance_group_header #arrow_icon");
if($arrowIcon.hasClass("expanded_open") == true) {
$arrowIcon.removeClass("expanded_open").addClass("expanded_close");
if($expandedFirstLevelMenu != null && $expandedSecondLevelMenu != null) //collapse other expanded menu if there is.
collapseFirstLevelMenu($expandedFirstLevelMenu, $expandedSecondLevelMenu);
$resourceArrowIcon = $("#leftmenu_resource").find("#resource_arrow");
if($resourceArrowIcon.hasClass("expanded_open") == true) {
$resourceArrowIcon.removeClass("expanded_open").addClass("expanded_close");
$("#leftmenu_zone_tree").find("#tree_container").empty();
}
var $vmGroupArrowIcon = $("#leftmenu_instance_group_header #arrow_icon");
if($vmGroupArrowIcon.hasClass("expanded_open") == true) {
$vmGroupArrowIcon.removeClass("expanded_open").addClass("expanded_close");
$("#leftmenu_instance_group_container").empty();
}
}