Merge pull request #2233 from Smidy13/develop

Improvement: isLoading Opacity Change for UiObject
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-10-27 02:02:10 -04:00
commit 52d8b7c631
2 files changed
+21

No files matched your search

@@ -21,6 +21,7 @@ function newUiObject() {
uiObjectTitle: undefined,
uiObjectMessage: undefined,
circularProgressBar: undefined,
isLoading: undefined,
isRunning: undefined,
isPlaying: undefined,
shortcutKey: undefined,
@@ -2420,6 +2421,14 @@ function newUiObject() {
/* Image */
if (icon !== undefined) {
if (icon.canDrawIcon === true) {
// 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
@@ -2453,6 +2462,8 @@ function newUiObject() {
position.y - totalImageSize / 2,
totalImageSize,
totalImageSize)
browserCanvasContext.globalAlpha = 1
}
}
@@ -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 {