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);