diff --git a/FloatingSpace/CodeEditor.js b/FloatingSpace/CodeEditor.js index a9cf2ed8d..933297c70 100644 --- a/FloatingSpace/CodeEditor.js +++ b/FloatingSpace/CodeEditor.js @@ -87,26 +87,28 @@ function newCodeEditor () { } function activate (payload) { - thisObject.visible = true - thisObject.payload = payload - thisObject.rawRadius = 8 - thisObject.targetRadius = thisObject.container.frame.radius - thisObject.currentRadius = 0 - const WIDTH = thisObject.container.frame.radius * 2.2 const HEIGHT = thisObject.container.frame.radius * 1 - let textArea = document.getElementById('textArea') - textArea.value = payload.node.code - textArea.style = 'resize: none; border: none; outline: none; box-shadow: none; overflow:hidden; font-family: Saira; font-size: 12px; background-color: rgb(204, 88, 53);color:rgb(255, 255, 255); width: ' + WIDTH + 'px; height: ' + HEIGHT + 'px' - textArea.style.display = 'block' - let textAreaPosition = { x: 0 - WIDTH / 2, y: 0 } textAreaPosition = thisObject.container.frame.frameThisPoint(textAreaPosition) + if (textAreaPosition.y < window.canvasApp.topMargin) { return } + + thisObject.visible = true + thisObject.payload = payload + thisObject.rawRadius = 8 + thisObject.targetRadius = thisObject.container.frame.radius + thisObject.currentRadius = 0 + + let textArea = document.getElementById('textArea') + textArea.value = payload.node.code + textArea.style = 'resize: none; border: none; outline: none; box-shadow: none; overflow:hidden; font-family: Saira; font-size: 12px; background-color: rgb(204, 88, 53);color:rgb(255, 255, 255); width: ' + WIDTH + 'px; height: ' + HEIGHT + 'px' + textArea.style.display = 'block' + textArea.focus() let textAreaDiv = document.getElementById('textAreaDiv') textAreaDiv.style = 'position:absolute; top:' + textAreaPosition.y + 'px; left:' + textAreaPosition.x + 'px; z-index:1; '