Files
duplicati/Duplicati/Server/webroot/ngax/scripts/controllers/DialogController.js
T
Kenneth Skovhede e4d8058cd3 Rewrote parts of the user interface.
This adds landing pages to restore and add, as requested in #2282 and #2293.
Added the app icon, and re-arranged the text as requested in #2286
2017-02-07 21:51:14 +01:00

33 lines
1.0 KiB
JavaScript

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);
};
});