2016-05-05 12:35:52 +02:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('harbor.repository')
|
|
|
|
.directive('pullCommand', pullCommand);
|
|
|
|
|
|
|
|
function PullCommandController() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function pullCommand() {
|
|
|
|
var directive = {
|
|
|
|
'restrict': 'E',
|
2016-06-16 08:10:35 +02:00
|
|
|
'templateUrl': '/static/resources/js/components/repository/pull-command.directive.html',
|
2016-05-05 12:35:52 +02:00
|
|
|
'scope': {
|
|
|
|
'repoName': '@',
|
|
|
|
'tag': '@'
|
|
|
|
},
|
|
|
|
'link': link,
|
|
|
|
'controller': PullCommandController,
|
|
|
|
'controllerAs': 'vm',
|
|
|
|
'bindToController': true
|
|
|
|
};
|
|
|
|
return directive;
|
|
|
|
|
|
|
|
function link(scope, element, attrs, ctrl) {
|
2016-05-16 08:21:59 +02:00
|
|
|
|
|
|
|
ctrl.harborRegUrl = $('#HarborRegUrl').val() + '/';
|
|
|
|
|
2016-05-24 07:50:09 +02:00
|
|
|
element.find('a').on('click', clickHandler);
|
|
|
|
function clickHandler(e) {
|
|
|
|
element.find('input[type="text"]').select();
|
|
|
|
}
|
2016-05-05 12:35:52 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|