From dd3fdac5e0145104ce5d7042ddc1d4988384f732 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Tue, 8 Apr 2025 23:17:45 +0500 Subject: [PATCH] add loader --- websiteFunctions/static/websiteFunctions/websiteFunctions.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index f8fc2f0c9..93f347632 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -2631,6 +2631,7 @@ app.controller('listWebsites', function ($scope, $http, $window) { $scope.getFurtherWebsitesFromDB(); $scope.showWPSites = function(domain) { + $scope.loading = false; console.log('showWPSites called for domain:', domain); // Make sure domain is defined @@ -2655,6 +2656,7 @@ app.controller('listWebsites', function ($scope, $http, $window) { 'X-CSRFToken': getCookie('csrftoken') } }).then(function(response) { + $scope.loading = true; console.log('Response received:', response); if (response.data.status === 1 && response.data.fetchStatus === 1) { // Find the website in the list and update its properties @@ -2672,6 +2674,7 @@ app.controller('listWebsites', function ($scope, $http, $window) { console.error('Error in response:', response.data.error_message); } }).catch(function(error) { + $scope.loading = true; $("#listFail").fadeIn(); $scope.errorMessage = error.message || 'An error occurred while fetching WordPress sites'; console.error('Request failed:', error);