Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Commit 8a64b97

Browse files
author
vikasrohit
committed
SUP-2788, Weblinks-- Mousehover on the whole card, but clicking on card is not opening up the weblink
-- Opened web link in new tab for external web link cards -- Prevented double new tabs for the link when clicked on the URL in the card itself
1 parent e52c2eb commit 8a64b97

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

app/directives/external-account/external-link-data.directive.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,4 @@
106106
p.link-title(data-ellipsis, ng-bind="account.title", ng-hide="account.status === 'PENDING'")
107107
p.link-title(ng-show="account.status === 'PENDING'") Loading data. This will take a few minutes.
108108

109-
a.link-url(ng-href="{{account.URL | urlProtocol}}", ng-bind="account.URL")
109+
a.link-url(ng-href="{{account.URL | urlProtocol}}", ng-bind="account.URL", target="_blank",prevent-event-propagation)

app/directives/external-account/external-links-data.directive.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
if (account.data && account.data.profileURL && account.data.status !== 'PENDING') {
3131
url = account.data.profileURL;
3232
}
33+
if (account.URL && account.status !== 'PENDING') {
34+
url = account.URL;
35+
}
3336
}
3437
if (url) {
3538
$window.open($filter('urlProtocol')(url), '_blank');
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(function() {
2+
'use strict';
3+
4+
angular.module('tcUIComponents').directive('preventEventPropagation', preventEventPropagation);
5+
6+
preventEventPropagation.$inject = ['$timeout', '$parse'];
7+
8+
function preventEventPropagation($timeout, $parse) {
9+
return function(scope, element, attr) {
10+
element.bind('click', function(evt) {
11+
evt.stopPropagation();
12+
});
13+
};
14+
}
15+
})();

app/index.jade

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ html
205205
script(src="directives/on-file-change.directive.js")
206206
script(src="directives/onoffswitch/onoffswitch.directive.js")
207207
script(src="directives/page-state-header/page-state-header.directive.js")
208+
script(src="directives/preventEventPropagation.directive.js")
208209
script(src="directives/profile-widget/profile-widget.directive.js")
209210
script(src="directives/responsive-carousel/responsive-carousel.directive.js")
210211
script(src="directives/skill-tile/skill-tile.directive.js")

0 commit comments

Comments
 (0)