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

30 lines
829 B
JavaScript
Raw Permalink Normal View History

2019-11-12 16:09:47 +00:00
/**
* An element which displays a dialog with the necessary credentials for a build 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 || !$scope.counter) {
$('#triggercredentialsmodal').modal('hide');
return;
}
$('#triggercredentialsmodal').modal({});
};
$scope.$watch('trigger', show);
$scope.$watch('counter', show);
}
};
return directiveDefinitionObject;
});