AC-1308 spinner lingers after 403 error

Happening on response to Delete prompt. Removed modal hide listener when starting spinner. Not sure why I thought that was needed. Instead, just close the dialog and start the spinner. If an error occurs, ProcessErrors always stops the spinner. Issue was caused by a race condition. ProcessErrors would sometimes fire tht stop before the event listener fired a start.
This commit is contained in:
Chris Houseknecht
2014-06-03 19:20:35 -04:00
parent ad5d0454c2
commit c517332191
8 changed files with 68 additions and 79 deletions

View File

@@ -102,10 +102,8 @@ function CredentialsList($scope, $rootScope, $location, $log, $routeParams, Rest
$scope.deleteCredential = function (id, name) { $scope.deleteCredential = function (id, name) {
var action = function () { var action = function () {
$('#prompt-modal').on('hidden.bs.modal', function () {
Wait('start');
});
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
Wait('start');
var url = defaultUrl + id + '/'; var url = defaultUrl + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.destroy() Rest.destroy()

View File

@@ -316,9 +316,7 @@ function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $com
var action = function () { var action = function () {
var url = defaultUrl + id + '/'; var url = defaultUrl + id + '/';
$('#prompt-modal').on('hidden.bs.modal', function () { Wait('start');
Wait('start');
});
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
Rest.setUrl(url); Rest.setUrl(url);
Rest.destroy() Rest.destroy()

View File

@@ -71,10 +71,8 @@ function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Res
$scope.deleteJobTemplate = function (id, name) { $scope.deleteJobTemplate = function (id, name) {
var action = function () { var action = function () {
$('#prompt-modal').on('hidden.bs.modal', function () {
Wait('start');
});
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
Wait('start');
var url = defaultUrl + id + '/'; var url = defaultUrl + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.destroy() Rest.destroy()

View File

@@ -69,10 +69,8 @@ function OrganizationsList($routeParams, $scope, $rootScope, $location, $log, Re
$scope.deleteOrganization = function (id, name) { $scope.deleteOrganization = function (id, name) {
var action = function () { var action = function () {
$('#prompt-modal').on('hidden.bs.modal', function () {
Wait('start');
});
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
Wait('start');
var url = defaultUrl + id + '/'; var url = defaultUrl + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.destroy() Rest.destroy()

View File

@@ -67,10 +67,8 @@ function PermissionsList($scope, $rootScope, $location, $log, $routeParams, Rest
$scope.deletePermission = function (id, name) { $scope.deletePermission = function (id, name) {
var action = function () { var action = function () {
$('#prompt-modal').on('hidden.bs.modal', function () {
Wait('start');
});
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
Wait('start');
var url = GetBasePath('base') + 'permissions/' + id + '/'; var url = GetBasePath('base') + 'permissions/' + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.destroy() Rest.destroy()

View File

@@ -233,10 +233,8 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
$scope.deleteProject = function (id, name) { $scope.deleteProject = function (id, name) {
var action = function () { var action = function () {
$('#prompt-modal').on('hiden.bs.modal', function () {
Wait('start');
});
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
Wait('start');
var url = defaultUrl + id + '/'; var url = defaultUrl + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.destroy() Rest.destroy()

View File

@@ -70,10 +70,11 @@ function UsersList($scope, $rootScope, $location, $log, $routeParams, Rest, Aler
$scope.deleteUser = function (id, name) { $scope.deleteUser = function (id, name) {
var action = function () { var action = function () {
$('#prompt-modal').on('hidden.bs.modal', function () { //$('#prompt-modal').on('hidden.bs.modal', function () {
Wait('start'); // Wait('start');
}); //});
$('#prompt-modal').modal('hide'); $('#prompt-modal').modal('hide');
Wait('start');
var url = defaultUrl + id + '/'; var url = defaultUrl + id + '/';
Rest.setUrl(url); Rest.setUrl(url);
Rest.destroy() Rest.destroy()