FIXED: Text editor cannot open outside visible area
This commit is contained in:
1 parent
8365f81e3b
commit
2a50934f91
2 files changed
+13
-1
No files matched your search
@@ -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; '
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
Reference in new issue
Block a user