Welcome to mirror list, hosted at ThFree Co, Russian Federation.

DialogController.js « controllers « scripts « ngax « webroot « Server « Duplicati - github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9b471600d0624933dd734982d60b2297774aafc4 (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
backupApp.controller('DialogController', function($scope, DialogService, gettextCatalog) {
    $scope.state = DialogService.watch($scope);

    function showTooltip(elem, msg) {
        elem.addEventListener('mouseleave', function(e) {
            e.currentTarget.setAttribute('class', 'button');
            e.currentTarget.removeAttribute('aria-label');
        });

        elem.setAttribute('class', 'button tooltipped tooltipped-w');
        elem.setAttribute('aria-label', msg);
    }

    $scope.onCopySuccess = function(e) {
        e.clearSelection();
        showTooltip(e.trigger, gettextCatalog.getString('Copied!'));
    };

    $scope.onCopyError = function(e) {
        showTooltip(e.trigger, gettextCatalog.getString('Copy failed. Please manually copy the URL'));
    };

    $scope.onButtonClick = function(index) {
        var cur = $scope.state.CurrentItem;
        var input = cur.textarea;
        DialogService.dismissCurrent();

        if (cur.callback)
            cur.callback(index, input, cur);
    };
    
});