reset code editor space while changing workspaces. forbid designer shortcuts while editing code

This commit is contained in:
Alexandru Stefan committed 2021-11-13 02:35:59 +02:00
1 parent 1c90ec5deb
commit 7cbb821601
5 files changed
+30 -10

No files matched your search

+6
View File
@@ -56,6 +56,7 @@ function newCanvas() {
UI.projects.foundations.spaces.sideSpace.finalize()
UI.projects.foundations.spaces.chartingSpace.finalize()
UI.projects.foundations.spaces.floatingSpace.finalize()
UI.projects.foundations.spaces.codeEditorSpace.finalize()
thisObject.shorcutNumbers = undefined
if (browserCanvas.removeEventListener) {
@@ -385,6 +386,11 @@ function newCanvas() {
if (UI.projects.education !== undefined && UI.projects.education.spaces.docsSpace.isVisible === true) {
return
}
/* When the Code Editor is Visible, we do not process key down events of the Designer Space. */
if (UI.projects.foundations.spaces.codeEditorSpace.isVisible === true) {
return
}
thisObject.mouse.event = event
thisObject.mouse.action = 'key down'
+1 -1
View File
@@ -140,7 +140,7 @@
<div id="governance-reports-space-div" class="governance-page" style="position:fixed; top:100000px; left:100000px">
<div id="governance-content-div"></div>
</div>
<div id="code-editor-space-div" class="governance-page" style="position:fixed; top:100000px; left:100000px">
<div id="code-editor-space-div" class="docs-page" style="position:fixed; top:100000px; left:100000px">
<div id="code-editor-content-div" class="code-editor-content-div">
</div>
</div>
@@ -5,6 +5,8 @@ function newFoundationsCodeEditorSpace() {
sidePanelTab: undefined,
container: undefined,
editorPage: undefined,
isVisible: undefined,
reset: reset,
openSpaceArea: openSpaceArea,
physics: physics,
draw: draw,
@@ -23,15 +25,24 @@ function newFoundationsCodeEditorSpace() {
return thisObject
function finalize() {
thisObject.sidePanelTab = undefined
if (isInitialized === false) { return }
thisObject.container.finalize()
thisObject.container = undefined
canvas.eventHandler.stopListening(browserResizedEventSubscriptionId)
thisObject.sidePanelTab.container.eventHandler.stopListening(openingEventSubscriptionId)
thisObject.sidePanelTab.container.eventHandler.stopListening(closingEventSubscriptionId)
UI.projects.foundations.spaces.sideSpace.deleteSidePanelTab('Foundations', 'javascript-code', 'Code', 'right')
thisObject.editorPage.finalize()
thisObject.editorPage = undefined
isInitialized = false
}
function initialize() {
thisObject.container = newContainer()
thisObject.container.name = MODULE_NAME
thisObject.container.initialize()
@@ -43,10 +54,7 @@ function newFoundationsCodeEditorSpace() {
resize()
thisObject.editorPage = newFoundationsCodeEditorEditorPage()
thisObject.footer = newGovernanceReportsFooter() // Reuse simple footer
thisObject.editorPage.initialize()
thisObject.footer.initialize()
thisObject.sidePanelTab = UI.projects.foundations.spaces.sideSpace.createSidePanelTab(thisObject.container, 'Foundations', 'javascript-code', 'Code', 'right')
@@ -66,6 +74,11 @@ function newFoundationsCodeEditorSpace() {
thisObject.editorPage.render(originatingNode, codeEditorType)
}
function reset() {
finalize()
initialize()
}
function physics() {
if (isInitialized === false) {
return
@@ -92,11 +105,11 @@ function newFoundationsCodeEditorSpace() {
}
function onOpening() {
thisObject.isVisible = true
}
function onClosing() {
thisObject.isVisible = false
}
function draw() {
@@ -211,7 +211,7 @@ function newFoundationsCodeEditorEditorPage() {
/**
* The autocomplete models will be based on:
* 1. Existing code in the data mines -> we will create models for each code node (it's like opening multiple files in vscode)
* 2. Formulas from data mines by creating an object representation of all formulas see implementation below than passing it to the monaco registerCompletionItemProvider
* 2. Formulas from data mines by creating an object representation of all formulas see implementation below then passing it to the monaco registerCompletionItemProvider
* 2. Trading engine loaded into the workspace - we create an obj. representation using getProtocolNode and we are using monaco registerCompletionItemProvider
*
*/
@@ -343,6 +343,7 @@ function newWorkspace() {
UI.projects.education.spaces.docsSpace.sidePanelTab.close()
UI.projects.foundations.spaces.workspaceSpace.sidePanelTab.close()
UI.projects.foundations.spaces.codeEditorSpace.sidePanelTab.close()
UI.projects.foundations.spaces.floatingSpace.inMapMode = true
workingAtTask = 2
break
@@ -446,7 +447,7 @@ function newWorkspace() {
UI.projects.governance.spaces.reportsSpace.reset()
UI.projects.governance.spaces.userProfileSpace.reset()
UI.projects.foundations.spaces.codeEditorSpace.reset()
await UI.projects.education.spaces.docsSpace.reset()
await UI.projects.education.spaces.tutorialSpace.reset()