Add the snapshot endpoint to web.py and have the phantomjs running only load the page's HTML once there are no further pending XHR requests

This commit is contained in:
Joseph Schorr 2013-11-18 17:11:06 -05:00
parent bde0a29296
commit 738973cf39
4 changed files with 87 additions and 1 deletions

View file

@ -1053,7 +1053,8 @@ quayApp.directive('ngBlur', function() {
};
});
quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', function($location, $rootScope, Restangular, UserService) {
quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', '$http',
function($location, $rootScope, Restangular, UserService, $http) {
Restangular.setErrorInterceptor(function(response) {
if (response.status == 401) {
$('#sessionexpiredModal').modal({});
@ -1068,4 +1069,13 @@ quayApp.run(['$location', '$rootScope', 'Restangular', 'UserService', function($
$rootScope.title = current.$$route.title;
}
});
var initallyChecked = false;
window.__isLoading = function() {
if (!initallyChecked) {
initallyChecked = true;
return true;
}
return $http.pendingRequests.length > 0;
};
}]);