From a4e9627d8834c5e43660241750794ede108637d2 Mon Sep 17 00:00:00 2001 From: Derrick Marcey Date: Thu, 3 Aug 2017 15:38:15 -0400 Subject: [PATCH] Use HostNavigationService to open TitleUrl in new window. --- src/Calendar/Views.ts | 17 ++++++++++++++--- vss-extension.json | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Calendar/Views.ts b/src/Calendar/Views.ts index 17ad764..6cbf7e9 100644 --- a/src/Calendar/Views.ts +++ b/src/Calendar/Views.ts @@ -9,6 +9,7 @@ import Controls_Navigation = require("VSS/Controls/Navigation"); import Controls_StatusIndicator = require("VSS/Controls/StatusIndicator"); import Q = require("q"); import Service = require("VSS/Service"); +import Services_Navigation = require("VSS/SDK/Services/Navigation"); import Tfs_Core_WebApi = require("TFS/Core/RestClient"); import TFS_Core_Contracts = require("TFS/Core/Contracts"); import Utils_Core = require("VSS/Utils/Core"); @@ -688,9 +689,19 @@ export class SummaryView extends Controls.BaseControl { var $sectionContainer = newElement("div", "category").appendTo(this.getElement()); var summaryTitle = source.name; source.getTitleUrl(VSS.getWebContext()).then((titleUrl) => { - if (titleUrl) { - $("

").html("" + summaryTitle + "").appendTo($sectionContainer); - } + if (titleUrl) { + var $link = newElement("a", "", summaryTitle); + $link.on('click', (eventObject) => { + VSS.getService(VSS.ServiceIds.Navigation).then((navigationService: Services_Navigation.HostNavigationService) => { + // Get current hash value from host url + navigationService.openNewWindow(titleUrl, ""); + }); + }); + + var $title = $("

"); + $link.appendTo($title); + $title.appendTo($sectionContainer); + } else { newElement("h3", "", summaryTitle).appendTo($sectionContainer); } diff --git a/vss-extension.json b/vss-extension.json index 0b5916f..46712ec 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -1,7 +1,7 @@ { "manifestVersion": 1, "id": "team-calendar", - "version": "0.5.0", + "version": "0.5.6", "publisher": "ms-devlabs", "name": "Team Calendar", "description": "Track events important to your team, view and manage days off, quickly see when sprints start and end, and more.",