mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -08:00
show loading indicator
This commit is contained in:
@@ -152,6 +152,12 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.debugger_wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.debugger, .problems {
|
.debugger, .problems {
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export class UI {
|
|||||||
: (this.eval_container = el('div', {class: 'eval'})),
|
: (this.eval_container = el('div', {class: 'eval'})),
|
||||||
el('div', 'bottom',
|
el('div', 'bottom',
|
||||||
this.debugger_container = el('div', 'debugger',
|
this.debugger_container = el('div', 'debugger',
|
||||||
|
this.debugger_loaded = el('div', 'debugger_wrapper',
|
||||||
el('div', 'tabs',
|
el('div', 'tabs',
|
||||||
this.tabs.calltree = el('div', 'tab',
|
this.tabs.calltree = el('div', 'tab',
|
||||||
el('a', {
|
el('a', {
|
||||||
@@ -51,6 +52,8 @@ export class UI {
|
|||||||
tabindex: 0,
|
tabindex: 0,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
this.debugger_loading = el('div', 'debugger_wrapper')
|
||||||
|
),
|
||||||
this.problems_container = el('div', {"class": 'problems', tabindex: 0}),
|
this.problems_container = el('div', {"class": 'problems', tabindex: 0}),
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -253,9 +256,24 @@ export class UI {
|
|||||||
render_debugger(state) {
|
render_debugger(state) {
|
||||||
this.debugger_container.style = ''
|
this.debugger_container.style = ''
|
||||||
this.problems_container.style = 'display: none'
|
this.problems_container.style = 'display: none'
|
||||||
|
if(
|
||||||
|
state.loading_external_imports_state != null
|
||||||
|
||
|
||||||
|
state.eval_modules_state != null
|
||||||
|
) {
|
||||||
|
this.debugger_loaded.style = 'display: none'
|
||||||
|
this.debugger_loading.innerText =
|
||||||
|
state.loading_external_imports_state != null
|
||||||
|
? 'Loading external modules...'
|
||||||
|
: 'Waiting...'
|
||||||
|
this.debugger_loading.style = ''
|
||||||
|
} else {
|
||||||
|
this.debugger_loading.style = 'display: none'
|
||||||
|
this.debugger_loaded.style = ''
|
||||||
this.calltree.render_calltree(state)
|
this.calltree.render_calltree(state)
|
||||||
this.logs.render_logs(null, state.logs)
|
this.logs.render_logs(null, state.logs)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render_problems(problems) {
|
render_problems(problems) {
|
||||||
this.debugger_container.style = 'display: none'
|
this.debugger_container.style = 'display: none'
|
||||||
|
|||||||
3
src/effects.js
vendored
3
src/effects.js
vendored
@@ -202,8 +202,7 @@ export const render_common_side_effects = (prev, next, command, ui) => {
|
|||||||
next.eval_modules_state != null
|
next.eval_modules_state != null
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// TODO if loading external imports, show loading indicator
|
ui.render_debugger(next)
|
||||||
ui.calltree.clear_calltree()
|
|
||||||
ui.editor.for_each_session((file, session) => clear_coloring(ui, file))
|
ui.editor.for_each_session((file, session) => clear_coloring(ui, file))
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user