aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js
blob: 6cb3f9c89bf3428cc6314ca5c4c7da7f2547ebe8 (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
33
(function () {
    'use strict';

    appDS2.controller("alertModalController", ["$uibModalInstance", "jobInfo",
        "$log", alertModalController]);

    function alertModalController($uibModalInstance, jobInfo,  $log) {
        var vm = this;
        var init = function() {
            if (jobInfo) {
                vm.content = jobInfo.message;
                vm.mode = jobInfo.status;
                if (vm.mode == "failed") {
                    vm.Header = "Failed"
                } else if (vm.mode == "confirm") {
                    vm.Header = "Confirm"
                } else {
                    vm.Header = "Success"
                }
            }
        };

        vm.close = function () {
            $uibModalInstance.close();
        };

        vm.ok = function () {
            $uibModalInstance.close(true);
        };

        init();
    }
})();