bugfix
This commit is contained in:
parent
536adc7887
commit
c53223235e
@ -8,7 +8,7 @@ SOURCES=" page_data_loader.js factory.js uitypesdef.js utils.js uitype.js \
|
|||||||
floaticonbar.js miniform.js wterm.js dynamicaccordion.js \
|
floaticonbar.js miniform.js wterm.js dynamicaccordion.js \
|
||||||
binstreaming.js streaming_audio.js vadtext.js rtc.js docxviewer.js \
|
binstreaming.js streaming_audio.js vadtext.js rtc.js docxviewer.js \
|
||||||
llm_dialog.js llm.js websocket.js datarow.js tabular.js \
|
llm_dialog.js llm.js websocket.js datarow.js tabular.js \
|
||||||
line.js pie.js bar.js gobang.js period.js "
|
line.js pie.js bar.js gobang.js period.js iconbarpage.js "
|
||||||
echo ${SOURCES}
|
echo ${SOURCES}
|
||||||
cat ${SOURCES} > ../dist/bricks.js
|
cat ${SOURCES} > ../dist/bricks.js
|
||||||
# uglifyjs --compress --mangle -- ../dist/bricks.js > ../dist/bricks.min.js
|
# uglifyjs --compress --mangle -- ../dist/bricks.js > ../dist/bricks.min.js
|
||||||
|
55
bricks/iconbarpage.js
Normal file
55
bricks/iconbarpage.js
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
var bricks = window.bricks || {};
|
||||||
|
bricks.IconbarPage = class extends bricks.VBox {
|
||||||
|
/*
|
||||||
|
opts={
|
||||||
|
bar_opts:
|
||||||
|
bar_at: top or bottom
|
||||||
|
}
|
||||||
|
bar_opts:{
|
||||||
|
margin:
|
||||||
|
rate:
|
||||||
|
tools:
|
||||||
|
}
|
||||||
|
tools = [
|
||||||
|
tool, ...
|
||||||
|
]
|
||||||
|
tool = {
|
||||||
|
name:
|
||||||
|
icon:
|
||||||
|
label: optional
|
||||||
|
tip,
|
||||||
|
dynsize
|
||||||
|
rate:
|
||||||
|
context:
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
constructor(opts){
|
||||||
|
opts.height = '100%'
|
||||||
|
opts.bar_at = opts.bar_at || 'top';
|
||||||
|
super(opts);
|
||||||
|
var bar = new bricks.IconTextBar(this.bar_opts);
|
||||||
|
this.content = new bricks.Filler({});
|
||||||
|
if (this.bar_at == 'top'){
|
||||||
|
this.add_widget(bar);
|
||||||
|
this.add_widget(this.content);
|
||||||
|
} else {
|
||||||
|
this.add_widget(this.content);
|
||||||
|
this.add_widget(bar);
|
||||||
|
}
|
||||||
|
bar.bind('command', this.command_handle.bind(this))
|
||||||
|
schedule_once(this.show_content.bind(this, this.bar_opts.tools[0]), 0.1);
|
||||||
|
}
|
||||||
|
async command_handle(event){
|
||||||
|
var tool = event.params;
|
||||||
|
await this.show_content(tool);
|
||||||
|
}
|
||||||
|
async show_content(tool){
|
||||||
|
var w = await bricks.widgetBuild(tool.content, this);
|
||||||
|
if (w && ! w.parent) {
|
||||||
|
this.content.add_widget(w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bricks.Factory.register('IconbarPage', bricks.IconbarPage);
|
@ -1,6 +1,7 @@
|
|||||||
var bricks = window.bricks || {};
|
var bricks = window.bricks || {};
|
||||||
bricks.Iframe = class extends bricks.Layout {
|
bricks.Iframe = class extends bricks.Layout {
|
||||||
constructor(opts){
|
constructor(opts){
|
||||||
|
opts.height = opts.height || '100%';
|
||||||
super(opts);
|
super(opts);
|
||||||
this.dom_element.src = opts.url;
|
this.dom_element.src = opts.url;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user