Skip to content

Commit

Permalink
Merge pull request #162 from Microsoft/users/demarcey/titleLinkOpenIn…
Browse files Browse the repository at this point in the history
…NewWindow

Use HostNavigationService to open TitleUrl in new window.
  • Loading branch information
dmarcey committed Aug 3, 2017
2 parents 7313a4d + a4e9627 commit 9c798b4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions src/Calendar/Views.ts
Expand Up @@ -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");
Expand Down Expand Up @@ -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) {
$("<h3>").html("<a target='_blank' href='" + titleUrl + "'>" + summaryTitle + "</a>").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 = $("<h3>");
$link.appendTo($title);
$title.appendTo($sectionContainer);
}
else {
newElement("h3", "", summaryTitle).appendTo($sectionContainer);
}
Expand Down
2 changes: 1 addition & 1 deletion 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.",
Expand Down

0 comments on commit 9c798b4

Please sign in to comment.