This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/ui/trigger-credentials-dialog.js
2015-04-16 14:58:25 -04:00

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;
});