blob: a08ef8d2436124f786be1c7f03deeca767a563fa [file] [log] [blame]
Andrew Geisslerba5e3f32018-05-24 10:58:00 -07001window.angular && (function(angular) {
2 'use strict';
Iftekharul Islamc0161392017-06-14 15:46:15 -05003
Andrew Geisslerd27bb132018-05-24 11:07:27 -07004 angular.module('app.common.directives').directive('firmwareList', [
5 'APIUtils',
6 function(APIUtils) {
Andrew Geisslerba5e3f32018-05-24 10:58:00 -07007 return {
8 'restrict': 'E',
9 'template': require('./firmware-list.html'),
Andrew Geisslerd27bb132018-05-24 11:07:27 -070010 'scope':
11 {'title': '@', 'firmwares': '=', 'filterBy': '=', 'version': '='},
12 'controller': [
13 '$rootScope', '$scope', 'dataService', '$location', '$timeout',
14 function($rootScope, $scope, dataService, $location, $timeout) {
15 $scope.dataService = dataService;
16 $scope.activate = function(imageId, imageVersion, imageType) {
17 $scope.$parent.activateImage(imageId, imageVersion, imageType);
18 };
Iftekharul Islamc0161392017-06-14 15:46:15 -050019
Andrew Geisslerd27bb132018-05-24 11:07:27 -070020 $scope.delete = function(imageId, imageVersion) {
21 $scope.$parent.deleteImage(imageId, imageVersion);
22 };
Iftekharul Islam1acb4122017-11-02 13:20:32 -050023
Andrew Geisslerd27bb132018-05-24 11:07:27 -070024 $scope.changePriority = function(imageId, imageVersion, from, to) {
25 $scope.$parent.changePriority(imageId, imageVersion, from, to);
26 };
27 }
28 ]
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070029 };
Andrew Geisslerd27bb132018-05-24 11:07:27 -070030 }
31 ]);
Gunnar Mills6473a412018-03-01 16:19:37 -060032})(window.angular);