1
0
mirror of https://github.com/salexdv/bsl_console.git synced 2024-11-24 08:33:29 +02:00

Доработка показа дерева переменных

This commit is contained in:
salexdv 2022-08-25 14:42:34 +03:00
parent 59aadbd9e3
commit 253b75a171
2 changed files with 12 additions and 3 deletions

View File

@ -36,6 +36,7 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
events_queue = [];
editor_options = [];
snippets = {};
treeview = null;
// #endregion
// #region public API
@ -1420,12 +1421,15 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
showVariablesDescription = function(variablesJSON) {
try {
showVariablesDisplay();
if (treeview != null)
hideVariablesDisplay();
const variables = JSON.parse(variablesJSON);
treeview = new Treeview("#variables-tree", editor, "./tree/icons/");
treeview.replaceData(variables);
showVariablesDisplay();
return true;
}
@ -3118,6 +3122,8 @@ define(['bslGlobals', 'bslMetadata', 'snippets', 'bsl_language', 'vs/editor/edit
let element = document.getElementById("display");
element.style.height = "0";
element.style.display = "none";
treeview.dispose();
treeview = null;
}

View File

@ -104,5 +104,8 @@ class Treeview {
this.open(id);
document.getElementById(id).focus();
document.getElementById(id).click();
}
};
dispose() {
document.querySelector(this.treeviewId).innerHTML = '';
};
}