View SSH Key modal

This commit is contained in:
Jimmy Zelinskie 2015-04-14 14:11:02 -04:00
parent f4ba7b41b3
commit 876d9c53f2
4 changed files with 73 additions and 2 deletions

View file

@ -0,0 +1,29 @@
/**
* An element which displays a dialog with the public SSH keycredentials for a trigger.
*/
angular.module('quay').directive('sshKeyDialog', function () {
var directiveDefinitionObject = {
priority: 0,
templateUrl: '/static/directives/ssh-key-dialog.html',
replace: false,
transclude: true,
restrict: 'C',
scope: {
'trigger': '=trigger',
'counter': '=counter'
},
controller: function($scope, $element) {
var show = function() {
if (!$scope.trigger) {
$('#sshkeymodal').modal('hide');
return;
}
$('#sshkeymodal').modal({});
};
$scope.$watch('trigger', show);
$scope.$watch('counter', show);
}
};
return directiveDefinitionObject;
});