Temporary Labels can be parametrized now

This commit is contained in:
Luis Fernando Molina committed 2019-05-13 12:13:43 +02:00
1 parent 92bad2738b
commit b66e8cd41d
4 files changed
+19 -5

No files matched your search

+3
View File
@@ -53,6 +53,9 @@ function newCircularMenu () {
menuItem.action = menuItemInitialValue.action
menuItem.actionFunction = menuItemInitialValue.actionFunction
menuItem.label = menuItemInitialValue.label
menuItem.workingLabel = menuItemInitialValue.workingLabel
menuItem.workDoneLabel = menuItemInitialValue.workDoneLabel
menuItem.workFailedLabel = menuItemInitialValue.workFailedLabel
menuItem.visible = menuItemInitialValue.visible
menuItem.imagePathOn = menuItemInitialValue.imagePathOn
menuItem.imagePathOff = menuItemInitialValue.imagePathOff
+13 -3
View File
@@ -9,6 +9,9 @@ function newCircularMenuItem () {
action: undefined,
actionFunction: undefined,
label: undefined,
workingLabel: undefined,
workDoneLabel: undefined,
workFailedLabel: undefined,
visible: false,
imagePathOn: undefined,
imagePathOff: undefined,
@@ -133,13 +136,20 @@ function newCircularMenuItem () {
async function onMouseClick (event) {
if (temporaryStatus === 0) {
setTemporaryStatus('Saving...', UI_COLOR.GREY, 500)
if (thisObject.workingLabel !== undefined) {
setTemporaryStatus(thisObject.workingLabel, UI_COLOR.GREY, 500)
}
let result = await thisObject.actionFunction(thisObject.payload, thisObject.action)
if (result === true) {
setTemporaryStatus('Saved', UI_COLOR.PATINATED_TURQUOISE, 250)
if (thisObject.workDoneLabel !== undefined) {
setTemporaryStatus(thisObject.workDoneLabel, UI_COLOR.PATINATED_TURQUOISE, 250)
}
} else {
setTemporaryStatus('Not Saved', UI_COLOR.TITANIUM_YELLOW, 500)
if (thisObject.workFailedLabel != undefined) {
setTemporaryStatus(thisObject.workFailedLabel, UI_COLOR.TITANIUM_YELLOW, 500)
}
}
}
}
+3 -1
View File
@@ -91,6 +91,9 @@ function newStrategyPart () {
action: 'Save Trading System',
actionFunction: thisObject.payload.onMenuItemClick,
label: 'Save Changes',
workingLabel: 'Saving...',
workDoneLabel: 'Saved',
workFailedLabel: 'Not Saved',
visible: false,
imagePathOn: 'Images/icons/style-01/upload.png',
imagePathOff: 'Images/icons/style-01/target.png',
@@ -654,4 +657,3 @@ function newStrategyPart () {
}
}
}
-1
View File
@@ -254,7 +254,6 @@ function newTradingSystem () {
}
case 'Open Settings':
break
case 'Delete Strategy':