blob: ec3a30e01afb695968f89831a06a6e6023fb377d [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 };
Ryan Arnell84e7a932018-12-13 10:50:17 -060027
28 $scope.toggleMoreDropdown = function(event, firmware) {
29 firmware.extended.show = !firmware.extended.show;
30 event.stopPropagation();
31 };
Andrew Geisslerd27bb132018-05-24 11:07:27 -070032 }
33 ]
Andrew Geisslerba5e3f32018-05-24 10:58:00 -070034 };
Andrew Geisslerd27bb132018-05-24 11:07:27 -070035 }
36 ]);
Gunnar Mills6473a412018-03-01 16:19:37 -060037})(window.angular);