Some Improvements
This commit is contained in:
1 parent
bf6724ff14
commit
ea7af51a62
2 files changed
+29
-31
No files matched your search
@@ -174,34 +174,34 @@ function newUiObjectConstructor() {
|
||||
uiObject.isVisibleFunction = canvas.floatingSpace.isThisPointVisible
|
||||
let menuItemsInitialValues = getMenuItemsInitialValues(uiObject, floatingObject, payload)
|
||||
|
||||
for (let i = 0; i < APP_SCHEMA_ARRAY.length; i++) {
|
||||
let schemaNode = APP_SCHEMA_ARRAY[i]
|
||||
if (schemaNode.type === payload.node.type) {
|
||||
let menuItems = schemaNode.menuItems
|
||||
for (let j = 0; j < menuItems.length; j++) {
|
||||
let item = menuItems[j]
|
||||
item.angle = undefined
|
||||
if (item.action.indexOf('Add Missing Children') >= 0) {
|
||||
item.action = 'Add Missing Children'
|
||||
}
|
||||
if (item.action.indexOf('Delete ') >= 0) {
|
||||
// item.action = 'Delete UI Object'
|
||||
}
|
||||
if (item.action.indexOf('Configure ') >= 0) {
|
||||
if (schemaNode.editors.config === true) {
|
||||
// item.actionFunction = 'uiObject.configEditor.activate'
|
||||
}
|
||||
}
|
||||
if (item.action.indexOf('Edit ') >= 0) {
|
||||
if (schemaNode.editors.code === true) {
|
||||
// item.actionFunction = 'uiObject.codeEditor.activate'
|
||||
}
|
||||
}
|
||||
if (item.actionFunction === undefined) {
|
||||
// item.actionFunction = 'payload.onMenuItemClick'
|
||||
}
|
||||
let schemaNode = APP_SCHEMA_MAP.get(payload.node.type)
|
||||
if (schemaNode === undefined) {
|
||||
console.log(payload.node.type + ' node found at App Schema. This node will not be created. ')
|
||||
return
|
||||
}
|
||||
let menuItems = schemaNode.menuItems
|
||||
for (let j = 0; j < menuItems.length; j++) {
|
||||
let item = menuItems[j]
|
||||
item.angle = undefined
|
||||
if (item.action.indexOf('Add Missing Children') >= 0) {
|
||||
item.action = 'Add Missing Children'
|
||||
}
|
||||
if (item.action.indexOf('Delete ') >= 0) {
|
||||
// item.action = 'Delete UI Object'
|
||||
}
|
||||
if (item.action.indexOf('Configure ') >= 0) {
|
||||
if (schemaNode.editors.config === true) {
|
||||
// item.actionFunction = 'uiObject.configEditor.activate'
|
||||
}
|
||||
}
|
||||
if (item.action.indexOf('Edit ') >= 0) {
|
||||
if (schemaNode.editors.code === true) {
|
||||
// item.actionFunction = 'uiObject.codeEditor.activate'
|
||||
}
|
||||
}
|
||||
if (item.actionFunction === undefined) {
|
||||
// item.actionFunction = 'payload.onMenuItemClick'
|
||||
}
|
||||
}
|
||||
|
||||
uiObject.initialize(payload, menuItemsInitialValues)
|
||||
|
||||
+3
-5
@@ -18,8 +18,6 @@ function newDashboard() {
|
||||
start: start
|
||||
}
|
||||
|
||||
const DEBUG_START_UP_DELAY = 0 // 3000; // This is a waiting time in case there is a need to debug the very first steps of initialization, to be able to hit F12 on time.
|
||||
|
||||
return thisObject
|
||||
|
||||
function start() {
|
||||
@@ -54,14 +52,14 @@ function newDashboard() {
|
||||
|
||||
if (canvas !== undefined) { canvas.finalize() }
|
||||
|
||||
setTimeout(delayedStart, DEBUG_START_UP_DELAY)
|
||||
startSuperalgos()
|
||||
}
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] start -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
|
||||
function delayedStart() {
|
||||
function startSuperalgos() {
|
||||
try {
|
||||
/* For now, we are supporting only one market. */
|
||||
|
||||
@@ -78,7 +76,7 @@ function newDashboard() {
|
||||
canvas = newCanvas()
|
||||
canvas.initialize()
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] delayedStart -> err = ' + err.stack) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] startSuperalgos -> err = ' + err.stack) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user