This commit is contained in:
yumoqing 2024-03-18 15:52:27 +08:00
parent a8be08e678
commit 16c42d5c17
8 changed files with 37 additions and 8 deletions

BIN
bricks/.DS_Store vendored

Binary file not shown.

View File

@ -3,7 +3,7 @@ SOURCES=" page_data_loader.js factory.js uitypesdef.js utils.js \
jsoncall.js myoperator.js scroll.js menu.js modal.js \
markdown_viewer.js video.js audio.js toolbar.js tab.js \
input.js registerfunction.js button.js accordion.js \
tree.js multiple_state_image.js dynamiccolumn.js form.js message.js \
tree.js multiple_state_image.js dynamiccolumn.js form.js message.js conform.js \
paging.js datagrid.js dataviewer.js iframe.js \
floaticonbar.js \
miniform.js wterm.js dynamicaccordion.js "

View File

@ -149,6 +149,16 @@ bricks.DynamicAccordion = class extends bricks.VScrollPanel {
info.add_widget(w);
}
delete_record(info, record){
var conform_w = new bricks.Conform({
title:'Delete conform',
message:'Are you sure to delete is record?'
});
conform_w.bind('conform', this.delete_record_act.bind(this, info, record));
}
delete_record_act(){
url = this.editable.delete_record_url + '?id=' + record.id;
var hc = new bricks.HttpClient();
var r = hc.get(url);
}
async build_new_form(){
var desc = {

View File

@ -27,7 +27,7 @@ bricks.BPopup = class extends bricks.VBox {
tb.set_css('title');
bricks.VBox.prototype.add_widget.bind(this)(tb);
var tit = new bricks.Text({otext:this.title, i18n:true});
this.content = new bricks.VBox({});
this.content = new bricks.Filler({});
bricks.VBox.prototype.add_widget.bind(this)(this.content);
tb.add_widget(tit);
this.holder = bricks.Body;
@ -60,7 +60,7 @@ bricks.BPopup = class extends bricks.VBox {
}
}
bricks.BMessage = class extends bricks.BPopup {
bricks.BMessage = class extends bricks.Modal {
/*
{
title:
@ -74,9 +74,19 @@ bricks.BMessage = class extends bricks.BPopup {
*/
constructor(opts){
super(opts);
this.create_message_widget();
this.set_css('message');
}
create_message_widget(){
this.message_w = new bricks.VBox({width:'100%',height:'100%'});
var w = new bricks.Filler();
this.message_w.add_widget(w);
var t = new bricks.Text({otext:this.opts.message,
wrap:true,
halign:'center',
i18n:true});
this.add_widget(t);
w.add_widget(t);
this.add_widget(this.message_w);
}
}

View File

@ -21,7 +21,7 @@ bricks.Modal = class extends bricks.Layout {
super(options);
this.set_width('100%');
this.set_height('100%');
this.ancestor_add_widget = Layout.prototype.add_widget.bind(this);
this.ancestor_add_widget = bricks.Layout.prototype.add_widget.bind(this);
this.panel = new bricks.VBox({});
this.ancestor_add_widget(this.panel);
this.panel.set_width(this.opts.width);
@ -30,18 +30,26 @@ bricks.Modal = class extends bricks.Layout {
this.panel.set_css('modal');
archorize(this.panel.dom_element, objget(this.opts, 'archor', 'cc'));
this.create_title();
this.content = new bricks.VBox({width:'100%'});
this.content = new bricks.Filler({width:'100%'});
this.panel.add_widget(this.content);
}
create_title(){
this.title_box = new bricks.HBox({width:'100%', height:'auto'});
this.title_box.set_css('title');
this.panel.add_widget(this.title_box);
this.title = new bricks.HBox({height:'100%'});
this.title_w = new bricks.Filler({height:'100%'});
var icon = new bricks.Icon({url:bricks_resource('imgs/delete.png')});
icon.bind('click', this.dismiss.bind(this));
this.title_box.add_widget(this.title);
this.title_box.add_widget(this.title_w);
this.title_box.add_widget(icon);
if (this.title){
var w = new bricks.Text({
otext:this.title,
i18n:true,
dynsize:true
});
this.title_w.add_widget(w);
}
}
get_zindex(){
var idx = bricks.last_zindex;

View File

@ -81,6 +81,7 @@ bricks.Video = class extends bricks.Layout {
}
report_ended(){
this.dispatch('play_end',{src:this.video_body.cur_url,type:this.video_body.cur_vtype});
}
report_playok(){
console.log(this.video_body.cur_url, 'play ok');
this.dispatch('play_ok', {src:this.video_body.cur_url,type:this.video_body.cur_vtype});

Binary file not shown.