29 lines
808 B
JavaScript
29 lines
808 B
JavaScript
/**
|
|
* 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;
|
|
});
|