summaryrefslogtreecommitdiffstats
path: root/app/common/directives/firmware-list.js
blob: 0404fe68cc3da808d07ab18bcd4d7f0652d5663c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
window.angular && (function (angular) {
    'use strict';

    angular
        .module('app.common.directives')
        .directive('firmwareList', ['APIUtils', function (APIUtils) {
            return {
                'restrict': 'E',
                'template': require('./firmware-list.html'),
                'scope': {
                   'title': '@',
                   'firmwares': '=',
                   'filterBy': '=',
                   'version': '='
                },
                'controller': ['$rootScope', '$scope','dataService', '$location', '$timeout', function($rootScope, $scope, dataService, $location, $timeout){
                    $scope.dataService = dataService;
                    $scope.activate = function(imageId){
                        $scope.$parent.activateImage(imageId);
                    }

                    $scope.delete = function(imageId, imageVersion){
                        $scope.$parent.deleteImage(imageId, imageVersion);
                    }

                    $scope.changePriority = function(imageId, imageVersion, from, to){
                        $scope.$parent.changePriority(imageId, imageVersion, from, to);
                    }
                }]
            };
        }]);
})(window.angular);
OpenPOWER on IntegriCloud