diff --git a/FloatingSpace/CodeEditor.js b/FloatingSpace/CodeEditor.js index 0a955e3c2..36a78e68e 100644 --- a/FloatingSpace/CodeEditor.js +++ b/FloatingSpace/CodeEditor.js @@ -36,16 +36,9 @@ function newCodeEditor () { let isMouseOver = false - let selfMouseOverEventSubscriptionId - let selfMouseClickEventSubscriptionId - let selfMouseNotOverEventSubscriptionId return thisObject function finalize () { - thisObject.container.eventHandler.stopListening(selfMouseOverEventSubscriptionId) - thisObject.container.eventHandler.stopListening(selfMouseClickEventSubscriptionId) - thisObject.container.eventHandler.stopListening(selfMouseNotOverEventSubscriptionId) - thisObject.container.finalize() thisObject.container = undefined thisObject.iconOK = undefined @@ -70,10 +63,6 @@ function newCodeEditor () { } thisObject.iconOK.src = window.canvasApp.urlPrefix + thisObject.imagePathOK thisObject.icon = thisObject.iconOK // The default value is ON. - - selfMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver) - selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick) - selfMouseNotOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver) } function deactivate () { @@ -137,22 +126,6 @@ function newCodeEditor () { thisObject.container.frame.position.y = 0 } - function onMouseOver (point) { - if (thisObject.container.frame.isThisPointHere(point, true, false) === true) { - isMouseOver = true - } else { - isMouseOver = false - } - } - - function onMouseNotOver (point) { - isMouseOver = false - } - - function onMouseClick (event) { - - } - function drawBackground () { if (thisObject.visible === true) { let position = { diff --git a/FloatingSpace/StrategyPart.js b/FloatingSpace/StrategyPart.js index 888c9292b..db1072685 100644 --- a/FloatingSpace/StrategyPart.js +++ b/FloatingSpace/StrategyPart.js @@ -383,6 +383,9 @@ function newStrategyPart () { function onNotFocus () { thisObject.isOnFocus = false + if (thisObject.codeEditor !== undefined) { + thisObject.codeEditor.deactivate() + } } function onMouseClick (event) {