diff --git a/web/gui/src/main/webapp/app/view/topo/topo.js b/web/gui/src/main/webapp/app/view/topo/topo.js index 14ca96ff64..90e94117ef 100644 --- a/web/gui/src/main/webapp/app/view/topo/topo.js +++ b/web/gui/src/main/webapp/app/view/topo/topo.js @@ -506,15 +506,24 @@ flash.enable(true); } + // initial set of topo events received, now do post-processing function topoStartDone() { - var d = $scope.intentData; - // give a small delay before attempting to reselect node(s) and stuff - // since they have to be re-added to the DOM first... + // give a small delay before attempting to reselect node(s) and + // highlight elements, since they have to be re-added to the DOM first... $timeout(function () { + $log.debug('^^ topo.topoStartDone() ^^'); + + // reselect the previous selection... tss.reselect(); - if (d) { - tts.selectIntent(d); + + // if an intent should be shown, invoke the appropriate callback + if ($scope.intentData) { + + // TODO: if a specific overlay was requested, activate that first + + tov.hooks.showIntent($scope.intentData); } + }, 200); } diff --git a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js index b04bd53168..c44b43a913 100644 --- a/web/gui/src/main/webapp/app/view/topo/topoOverlay.js +++ b/web/gui/src/main/webapp/app/view/topo/topoOverlay.js @@ -284,6 +284,13 @@ return cb && extra ? cb(data, extra) : data; } + // Request from Intent View to visualize an intent on the topo view + function showIntentHook(intentData) { + $log.debug('^^ topoOverlay.showIntentHook(...) ^^'); + var cb = _hook('showintent'); + return cb && cb(intentData); + } + // === ----------------------------------------------------- // Event (from server) Handlers @@ -435,7 +442,8 @@ multiSelect: multiSelectHook, mouseOver: mouseOverHook, mouseOut: mouseOutHook, - modifyLinkData: modifyLinkDataHook + modifyLinkData: modifyLinkDataHook, + showIntent: showIntentHook }, showHighlights: showHighlights diff --git a/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js b/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js index 304b4e6fc5..13a5f2a4b4 100644 --- a/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js +++ b/web/gui/src/main/webapp/app/view/topo/topoTrafficNew.js @@ -141,6 +141,12 @@ }, mouseout: function () { tts.requestTrafficForMode(true); + }, + + // intent visualization hook + showintent: function (intentData) { + $log.debug('^^ trafficOverlay.showintent() ^^'); + tts.selectIntent(intentData); } } };