Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e52c2eb

Browse files
author
vikasrohit
committedDec 9, 2015
SUP-2150, Clicking on external account cards (profile) does nothing
-- Added click listener to open the profile URL, if available for external accounts cards (not for external web links)
1 parent 76cc49c commit e52c2eb

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
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
@@ -1,5 +1,5 @@
11
.external-link-list
2-
div.external-link-tile(ng-repeat="account in linkedAccountsData", ng-class="{'external-link-tile--editable' : editable}")
2+
div.external-link-tile(ng-repeat="account in linkedAccountsData", ng-class="{'external-link-tile--editable' : editable, 'external-link-tile--pending' : account.status === 'PENDING' || account.data.status === 'PENDING'}", ng-click="openLink(account)")
33
.top
44
.ext-link-tile_edit-header(ng-show="editable && account.provider === 'weblink'")
55
.ext-link-tile_edit-header_delete(ng-click="confirmDeletion(account)", ng-class="{'ext-link-tile_edit-header_delete--disabled': account.deletingAccount || account.status === 'PENDING'}")

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@
1818
editable: '=',
1919
userHandle: '@'
2020
},
21-
controller: ['$log', '$scope', 'ExternalWebLinksService', 'toaster', 'ngDialog',
22-
function($log, $scope, ExternalWebLinksService, toaster, ngDialog) {
21+
controller: ['$log', '$scope', '$window', '$filter', 'ExternalWebLinksService', 'toaster', 'ngDialog',
22+
function($log, $scope, $window, $filter, ExternalWebLinksService, toaster, ngDialog) {
2323

2424
$log = $log.getInstance("ExternalLinksDataCtrl");
2525
$scope.deletionDialog = null;
2626

27+
$scope.openLink = function(account) {
28+
var url = null;
29+
if (account) {
30+
if (account.data && account.data.profileURL && account.data.status !== 'PENDING') {
31+
url = account.data.profileURL;
32+
}
33+
}
34+
if (url) {
35+
$window.open($filter('urlProtocol')(url), '_blank');
36+
}
37+
}
38+
2739
$scope.confirmDeletion = function(account) {
2840
$scope.deletionDialog = ngDialog.open({
2941
className: 'ngdialog-theme-default tc-dialog',

‎assets/css/directives/external-link-data.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,5 +313,11 @@ external-accounts {
313313
.external-link-tile--editable {
314314
// height: 285px;
315315
}
316+
317+
.external-link-tile--pending {
318+
&:hover {
319+
cursor: default;
320+
}
321+
}
316322
}
317323
}

0 commit comments

Comments
 (0)
This repository has been archived.