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/image-view-layer.js
Joseph Schorr 1d60414a23 Cleanup display of image commands to be better shared
Also moves the work into a TS component
2017-06-23 14:53:02 -04:00

32 lines
No EOL
807 B
JavaScript

/**
* An element which displays a single layer representing an image in the image view.
*/
angular.module('quay').directive('imageViewLayer', function () {
var directiveDefinitionObject = {
priority: 0,
templateUrl: '/static/directives/image-view-layer.html',
replace: false,
transclude: true,
restrict: 'C',
scope: {
'repository': '=repository',
'image': '=image',
'images': '=images'
},
controller: function($scope, $element) {
$scope.getClass = function() {
var index = $.inArray($scope.image, $scope.images);
if (index < 0) {
return 'first';
}
if (index == $scope.images.length - 1) {
return 'last';
}
return '';
};
}
};
return directiveDefinitionObject;
});