From 7fd6dae0378412f9dd3dcaa9ef03420515a5c70b Mon Sep 17 00:00:00 2001 From: phamt Date: Wed, 5 Oct 2011 14:30:24 +0000 Subject: [PATCH] Load summary page by default on start-up. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10705 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-UI/js/nodes/nodes.js | 26 +++++++++++++++----------- xCAT-UI/js/ui.js | 1 + 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index 528c96781..d64be8dfb 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -344,19 +344,23 @@ function drawNodesArea(targetgroup, cmdargs, message){ // Get last view (if any) // This can be summary, nodes, or graphic - var order = $.cookie('tabindex_history').split(','); - order[0] = parseInt(order[0]); - order[1] = parseInt(order[1]); - if (order[0] == 0 || order[1] == 0) { - // For some reason, you cannot trigger a select of index 0 - loadPieSummary(targetgroup); - } else if (order[0] == 1 || order[0] == 2) { - $('#nodesPageTabs').tabs('select', order[0]); - } else if (order[1] == 1 || order[1] == 2) { - $('#nodesPageTabs').tabs('select', order[1]); + if ($.cookie('tabindex_history')) { + var order = $.cookie('tabindex_history').split(','); + order[0] = parseInt(order[0]); + order[1] = parseInt(order[1]); + if (order[0] == 0 || order[1] == 0) { + // For some reason, you cannot trigger a select of index 0 + loadPieSummary(targetgroup); + } else if (order[0] == 1 || order[0] == 2) { + $('#nodesPageTabs').tabs('select', order[0]); + } else if (order[1] == 1 || order[1] == 2) { + $('#nodesPageTabs').tabs('select', order[1]); + } else { + loadPieSummary(targetgroup); + } } else { loadPieSummary(targetgroup); - } + } } /** diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index 2d981f8d8..15ddf68e1 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -42,6 +42,7 @@ Tab.prototype.init = function() { // Create an array to track the tab selected order = new Array; order[0] = ui.index; + order[1] = ui.index; } $.cookie('tabindex_history', order);