This commit is contained in:
yumoqing 2024-03-18 15:53:01 +08:00
parent 16c42d5c17
commit 450fc2888c

40
bricks/conform.js Normal file
View File

@ -0,0 +1,40 @@
var bricks = window.bricks || {};
bricks.Conform = class extends bricks.BMessage {
constructor(opts){
opts.auto_dismiss = false;
super(opts);
this.create_btns();
}
create_tooolbar(){
desc = {
tools:[
bricks.extend({
"name":"conform",
"icon":bricks_resource('imgs/conform.png'),
"label":'Conform'
}, this.opts.conform||{}),
bricks.extend({
"name":"cancel",
"icon":bricks_resource('imgs/cancel.png'),
"label":"Discard"
}, this.opts.discard||{})
]
}
w = new bricks.IconTextBar(desc);
w.bind('conform', this.conform_hndl.bind(this));
w.bind('discard', this.discard_hndl.bind(this));
if (!w) return;
this.message_w.add_widget(w);
}
conform_hndl(event){
this.dismiss();
this.dispatch('conform');
}
discard_hndl(event){
this.dismiss();
this.dispatch('discard');
}
}
bricks.Factory.register('Conform', bricks.Conform);