Confirmation to Delete Items
This commit is contained in:
1 parent
1b012b4b13
commit
77ddff6d1d
3 files changed
+32
-1
No files matched your search
@@ -67,6 +67,7 @@ function newCircularMenu () {
|
||||
menuItem.currentStatus = menuItemInitialValue.currentStatus
|
||||
menuItem.relatedStrategyPart = menuItemInitialValue.relatedStrategyPart
|
||||
menuItem.dontShowAtFullscreen = menuItemInitialValue.dontShowAtFullscreen
|
||||
menuItem.askConfirmation = menuItemInitialValue.askConfirmation
|
||||
|
||||
if (menuItem.label === undefined) {
|
||||
menuItem.type = 'Icon Only'
|
||||
|
||||
@@ -5,6 +5,7 @@ function newCircularMenuItem () {
|
||||
let thisObject = {
|
||||
type: undefined,
|
||||
isDeployed: undefined,
|
||||
askConfirmation: undefined,
|
||||
iconOn: undefined,
|
||||
iconOff: undefined,
|
||||
currentIcon: undefined,
|
||||
@@ -170,7 +171,7 @@ function newCircularMenuItem () {
|
||||
}
|
||||
|
||||
async function onMouseClick (event) {
|
||||
if (temporaryStatus === 0) {
|
||||
if (temporaryStatus === 0 && thisObject.askConfirmation !== true) {
|
||||
if (thisObject.workingLabel !== undefined) {
|
||||
setTemporaryStatus(thisObject.workingLabel, UI_COLOR.GREY, 500)
|
||||
}
|
||||
@@ -187,6 +188,14 @@ function newCircularMenuItem () {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (temporaryStatus > 0 && thisObject.askConfirmation === true) {
|
||||
thisObject.currentStatus = await thisObject.actionFunction(thisObject.payload, thisObject.action)
|
||||
}
|
||||
|
||||
if (temporaryStatus === 0 && thisObject.askConfirmation === true) {
|
||||
setTemporaryStatus('Confirm to Delete', UI_COLOR.GREY, 50)
|
||||
}
|
||||
}
|
||||
|
||||
function setTemporaryStatus (text, backgroundColor, waitingCycles) {
|
||||
|
||||
@@ -186,6 +186,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Trading System',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Trading System',
|
||||
visible: false,
|
||||
@@ -268,6 +269,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Parameters',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Parameters',
|
||||
visible: false,
|
||||
@@ -336,6 +338,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Base Asset',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Base Asset',
|
||||
visible: false,
|
||||
@@ -417,6 +420,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Strategy',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Strategy',
|
||||
visible: false,
|
||||
@@ -498,6 +502,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Trigger Stage',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Stage',
|
||||
visible: false,
|
||||
@@ -566,6 +571,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Open Stage',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Stage',
|
||||
visible: false,
|
||||
@@ -634,6 +640,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Manage Stage',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Stage',
|
||||
visible: false,
|
||||
@@ -690,6 +697,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Close Stage',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Stage',
|
||||
visible: false,
|
||||
@@ -746,6 +754,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Position Size',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete Trading System',
|
||||
visible: false,
|
||||
@@ -828,6 +837,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Event',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Event',
|
||||
visible: false,
|
||||
@@ -897,6 +907,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Event',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Event',
|
||||
visible: false,
|
||||
@@ -966,6 +977,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Event',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Event',
|
||||
visible: false,
|
||||
@@ -1034,6 +1046,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Initial Definition',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Definition',
|
||||
visible: false,
|
||||
@@ -1103,6 +1116,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Managed Item',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Item',
|
||||
visible: false,
|
||||
@@ -1172,6 +1186,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Managed Item',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Item',
|
||||
visible: false,
|
||||
@@ -1254,6 +1269,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Phase',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Phase',
|
||||
visible: false,
|
||||
@@ -1328,6 +1344,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Formula',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Formula',
|
||||
visible: false,
|
||||
@@ -1397,6 +1414,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Event',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Event',
|
||||
visible: false,
|
||||
@@ -1466,6 +1484,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Situation',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Situation',
|
||||
visible: false,
|
||||
@@ -1535,6 +1554,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Condition',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Condition',
|
||||
visible: false,
|
||||
@@ -1609,6 +1629,7 @@ function newStrategyPartConstructor () {
|
||||
},
|
||||
{
|
||||
action: 'Delete Code',
|
||||
askConfirmation: true,
|
||||
actionFunction: payload.onMenuItemClick,
|
||||
label: 'Delete This Code',
|
||||
visible: false,
|
||||
|
||||
Reference in new issue
Block a user