mirror of
https://github.com/salexdv/bsl_console.git
synced 2024-11-28 08:48:48 +02:00
Доработка показа дерева переменных
This commit is contained in:
parent
59aadbd9e3
commit
253b75a171
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
@ -104,5 +104,8 @@ class Treeview {
|
||||
this.open(id);
|
||||
document.getElementById(id).focus();
|
||||
document.getElementById(id).click();
|
||||
}
|
||||
};
|
||||
dispose() {
|
||||
document.querySelector(this.treeviewId).innerHTML = '';
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user