Refactor modals into template
This commit is contained in:
20
gui/app.js
20
gui/app.js
@@ -337,7 +337,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
||||
|
||||
$scope.restart = function () {
|
||||
restarting = true;
|
||||
$scope.restartingHeader = "Restarting"
|
||||
$scope.restartingTitle = "Restarting"
|
||||
$scope.restartingBody = "Syncthing is restarting."
|
||||
$('#restarting').modal({backdrop: 'static', keyboard: false});
|
||||
$http.post(urlbase + '/restart');
|
||||
@@ -360,7 +360,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http) {
|
||||
};
|
||||
|
||||
$scope.upgrade = function () {
|
||||
$scope.restartingHeader = "Upgrading"
|
||||
$scope.restartingTitle = "Upgrading"
|
||||
$scope.restartingBody = "Syncthing is upgrading."
|
||||
$('#restarting').modal({backdrop: 'static', keyboard: false});
|
||||
$http.post(urlbase + '/upgrade').success(function () {
|
||||
@@ -886,3 +886,19 @@ syncthing.directive('validNodeid', function() {
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
syncthing.directive('modal', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: 'modal.html',
|
||||
replace: true,
|
||||
transclude: true,
|
||||
scope: {
|
||||
title: '@',
|
||||
status: '@',
|
||||
icon: '@',
|
||||
close: '@',
|
||||
large: '@',
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user