From 67355c875d038e62abbde8248535f46832356b51 Mon Sep 17 00:00:00 2001 From: Smidy13 <77650800+Smidy13@users.noreply.github.com> Date: Wed, 27 Oct 2021 11:24:17 +1300 Subject: [PATCH] Improvement: isLoading Opacity Change for UiObject --- .../Foundations/UI/Spaces/Floating-Space/UiObject.js | 9 ++++++--- .../UI/Spaces/User-Profile-Space/UserProfile.js | 10 ++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js index dd8fdd58f..503354fbf 100644 --- a/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js +++ b/Projects/Foundations/UI/Spaces/Floating-Space/UiObject.js @@ -21,6 +21,7 @@ function newUiObject() { uiObjectTitle: undefined, uiObjectMessage: undefined, circularProgressBar: undefined, + isLoading: undefined, isRunning: undefined, isPlaying: undefined, shortcutKey: undefined, @@ -2421,10 +2422,13 @@ function newUiObject() { if (icon !== undefined) { if (icon.canDrawIcon === true) { - // If this is a User Profile and blockchainTokens is still being loaded then display at half opacity - if(thisObject.payload.node.type === "User Profile" && thisObject.payload.blockchainTokens === undefined) { + // If this UiObject is being loaded then display at half opacity + if(thisObject.payload.isLoading === true) { browserCanvasContext.globalAlpha = 0.5 + } else { + browserCanvasContext.globalAlpha = 1 } + let additionalImageSize = 0 if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 } let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize @@ -2459,7 +2463,6 @@ function newUiObject() { totalImageSize, totalImageSize) } - browserCanvasContext.globalAlpha = 1 } if (executingIcon !== undefined) { diff --git a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js index 6d130f1e6..8bf1391cf 100644 --- a/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js +++ b/Projects/Governance/UI/Spaces/User-Profile-Space/UserProfile.js @@ -55,6 +55,13 @@ function newGovernanceUserProfileSpace() { } } let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile') + + // Initialise the isLoading parameter for each User Profile + for (let i = 0; i < userProfiles.length; i++) { + let userProfile = userProfiles[i] + + userProfile.payload.isLoading = true + } /* let pools = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('Pools') let assets = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('Assets') @@ -374,11 +381,13 @@ function newGovernanceUserProfileSpace() { if (userProfile.payload === undefined) { continue } if (userProfile.payload.bloackchainBalancesLoading === true) { + userProfile.payload.isLoading = true return } if (userProfile.payload.blockchainTokens === undefined) { userProfile.payload.bloackchainBalancesLoading = true + userProfile.payload.isLoading = true UI.projects.foundations.spaces.cockpitSpace.setStatus('Loading blockchain balances for User Profile # ' + (i + 1) + ' / ' + userProfiles.length, 1500, UI.projects.foundations.spaces.cockpitSpace.statusTypes.ALL_GOOD) getBlockchainAccount(userProfile) @@ -461,6 +470,7 @@ function newGovernanceUserProfileSpace() { return response.json(); }).then(function (data) { userProfile.payload.bloackchainBalancesLoading = false + userProfile.payload.isLoading = false if (data.result === "Max rate limit reached, please use API Key for higher rate limit") { userProfile.payload.blockchainTokens = undefined } else {