From 0ef4868f24ae8bb39398c0723bb48e4874c80361 Mon Sep 17 00:00:00 2001 From: Joseph White Date: Fri, 5 May 2017 11:52:12 -0400 Subject: [PATCH] Fix the node selection algorithm broken in #117 The algorithm that determines whether a node should be selected was incorrectly broken in the cleanup task in #117. This pull request restores the original code. --- html/gui/js/modules/job_viewer/JobViewer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/html/gui/js/modules/job_viewer/JobViewer.js b/html/gui/js/modules/job_viewer/JobViewer.js index 1ace9dccc0..110b94a58f 100644 --- a/html/gui/js/modules/job_viewer/JobViewer.js +++ b/html/gui/js/modules/job_viewer/JobViewer.js @@ -909,7 +909,7 @@ XDMoD.Module.JobViewer = Ext.extend(XDMoD.PortalModule, { return; } - var token = CCR.tokenize(Ext.History.getToken()); + var token = CCR.tokenize(document.location.hash); var params = Ext.urlDecode(token.params); if (params.job) { @@ -920,9 +920,10 @@ XDMoD.Module.JobViewer = Ext.extend(XDMoD.PortalModule, { if (!params.realm) { return; } + var selectionModel = this.searchHistoryPanel.getSelectionModel(); var path = this._getPath(token.raw); - var isSelected = this.compareNodePath(this.currentNode, path); + var isSelected = this.compareNodePath(this.currentNode, path) && selectionModel && CCR.exists(selectionModel.getSelectedNode()); if (!isSelected) { this.searchHistoryPanel.fireEvent('expand_node', path);