This commit is contained in:
yhirose 2022-06-10 17:34:19 -04:00
parent 6d92d503cc
commit 5a83950514

View File

@ -152,6 +152,18 @@ $('#auto-refresh').on('change', () => {
}); });
$('#parse').on('click', parse); $('#parse').on('click', parse);
// Resize editors to fit their parents
function resizeEditorsToParent() {
code.resize();
code.renderer.updateFull();
codeAst.resize();
codeAst.renderer.updateFull();
codeAstOptimized.resize();
codeAstOptimized.renderer.updateFull();
codeProfile.resize();
codeProfile.renderer.updateFull();
}
// Show windows // Show windows
function setupToolWindow(lsKeyName, buttonSel, codeSel) { function setupToolWindow(lsKeyName, buttonSel, codeSel) {
let show = localStorage.getItem(lsKeyName) === 'true'; let show = localStorage.getItem(lsKeyName) === 'true';
@ -162,6 +174,7 @@ function setupToolWindow(lsKeyName, buttonSel, codeSel) {
show = !show; show = !show;
localStorage.setItem(lsKeyName, show); localStorage.setItem(lsKeyName, show);
$(codeSel).css({ 'display': show ? 'block' : 'none' }); $(codeSel).css({ 'display': show ? 'block' : 'none' });
resizeEditorsToParent();
}); });
} }
setupToolWindow('show-ast', '#show-ast', '#code-ast'); setupToolWindow('show-ast', '#show-ast', '#code-ast');