directives: ssh-key-dialog -> trigger credentials
This commit is contained in:
parent
2236270741
commit
de3fa5f42d
6 changed files with 52 additions and 38 deletions
29
static/js/directives/ui/trigger-credentials-dialog.js
Normal file
29
static/js/directives/ui/trigger-credentials-dialog.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
/**
|
||||
* An element which displays a dialog with the public SSH keycredentials for a trigger.
|
||||
*/
|
||||
angular.module('quay').directive('triggerCredentialsDialog', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/trigger-credentials-dialog.html',
|
||||
replace: false,
|
||||
transclude: true,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'trigger': '=trigger',
|
||||
'counter': '=counter'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
var show = function() {
|
||||
if (!$scope.trigger) {
|
||||
$('#triggercredentialsmodal').modal('hide');
|
||||
return;
|
||||
}
|
||||
$('#triggercredentialsmodal').modal({});
|
||||
};
|
||||
|
||||
$scope.$watch('trigger', show);
|
||||
$scope.$watch('counter', show);
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
Reference in a new issue