diff --git a/FloatingSpace/CodeEditor.js b/FloatingSpace/CodeEditor.js index cd671d28d..edd2cfd74 100644 --- a/FloatingSpace/CodeEditor.js +++ b/FloatingSpace/CodeEditor.js @@ -3,6 +3,7 @@ function newCodeEditor () { const MODULE_NAME = 'Circular Menu Iem' let thisObject = { + isVisibleFunction: undefined, iconOK: undefined, iconNOT_OK: undefined, visible: false, @@ -42,6 +43,7 @@ function newCodeEditor () { thisObject.iconOK = undefined thisObject.iconNOT_OK = undefined thisObject.payload = undefined + thisObject.isVisibleFunction = undefined } function initialize () { @@ -135,7 +137,15 @@ function newCodeEditor () { } textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition) - if (textAreaPosition.y < window.canvasApp.topMargin) { deactivate() } + if (thisObject.visible === true) { + let checkPosition = { + x: textAreaPosition.x, + y: textAreaPosition.y - window.canvasApp.topMargin + } + if (thisObject.isVisibleFunction(checkPosition) === false) { + deactivate() + } + } if (thisObject.visible === true) { let textAreaDiv = document.getElementById('textAreaDiv') textAreaDiv.style = 'position:absolute; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; ' diff --git a/FloatingSpace/StrategyPart.js b/FloatingSpace/StrategyPart.js index 9c308a3f4..30569f65e 100644 --- a/FloatingSpace/StrategyPart.js +++ b/FloatingSpace/StrategyPart.js @@ -242,6 +242,7 @@ function newStrategyPart () { case 'Phase': { imagePath = 'Images/icons/style-01/testing.png' thisObject.codeEditor = newCodeEditor() + thisObject.codeEditor.isVisibleFunction = thisObject.isVisibleFunction thisObject.codeEditor.initialize() thisObject.codeEditor.container.connectToParent(thisObject.container, false, false, true, true, false, false, false, false) @@ -317,6 +318,7 @@ function newStrategyPart () { case 'Condition': { imagePath = 'Images/icons/style-01/testing.png' thisObject.codeEditor = newCodeEditor() + thisObject.codeEditor.isVisibleFunction = thisObject.isVisibleFunction thisObject.codeEditor.initialize() thisObject.codeEditor.container.connectToParent(thisObject.container, false, false, true, true, false, false, false, false) menuItemsInitialValues = [