mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-12-04 23:31:05 +01:00
Fix bug with modal's event handling
This commit is contained in:
parent
49c315f7cd
commit
e050f53e70
@ -105,10 +105,12 @@ define(['controllers/projects/taskRunner'], function () {
|
|||||||
scope.repositories = $scope.repos;
|
scope.repositories = $scope.repos;
|
||||||
scope.environment = $scope.environment;
|
scope.environment = $scope.environment;
|
||||||
|
|
||||||
$modal.open({
|
var modal = $modal.open({
|
||||||
templateUrl: '/tpl/projects/templates/add.html',
|
templateUrl: '/tpl/projects/templates/add.html',
|
||||||
scope: scope
|
scope: scope
|
||||||
}).result.then(function (opts) {
|
});
|
||||||
|
|
||||||
|
modal.result.then(function (opts) {
|
||||||
if (opts.remove) {
|
if (opts.remove) {
|
||||||
return $scope.remove(template);
|
return $scope.remove(template);
|
||||||
}
|
}
|
||||||
@ -119,7 +121,9 @@ define(['controllers/projects/taskRunner'], function () {
|
|||||||
}).catch(function (response) {
|
}).catch(function (response) {
|
||||||
swal('error', 'could not add template:' + response.status, 'error');
|
swal('error', 'could not add template:' + response.status, 'error');
|
||||||
});
|
});
|
||||||
}).closed.then(function () {
|
});
|
||||||
|
|
||||||
|
modal.closed.then(function () {
|
||||||
$scope.reload();
|
$scope.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user