This commit is contained in:
yumoqing 2024-05-06 16:21:56 +08:00
parent 03afb3950e
commit 32305d3db7
3 changed files with 26 additions and 2 deletions

View File

@ -41,7 +41,7 @@ bricks.DataRow = class extends bricks.HBox {
tools.push({ tools.push({
name:'add', name:'add',
tip:'add new record', tip:'add new record',
icon:this.editable.add_icon || bricks_resource('imgs/add.png') icon:editable.add_icon || bricks_resource('imgs/add.png')
}); });
tools.push({ tools.push({
name:'blankicon' name:'blankicon'

View File

@ -79,6 +79,7 @@ bricks.BaseModal = class extends bricks.Layout {
if (this.timeout > 0){ if (this.timeout > 0){
this.timeout_task = schedule_once(this.dismiss.bind(this), this.timeout); this.timeout_task = schedule_once(this.dismiss.bind(this), this.timeout);
} }
this.dispatch('opened');
} }
dismiss(){ dismiss(){
this.dom_element.style.display = "none"; this.dom_element.style.display = "none";
@ -87,6 +88,7 @@ bricks.BaseModal = class extends bricks.Layout {
this.timeout_task.cancel(); this.timeout_task.cancel();
this.timeout_task = null; this.timeout_task = null;
} }
this.dispatch('dismissed');
} }
} }
bricks.Modal = class extends bricks.BaseModal { bricks.Modal = class extends bricks.BaseModal {

View File

@ -18,4 +18,26 @@ bricks.add_ViewBuilder('icon', function(opts){
options.url = opts.value; options.url = opts.value;
return new bricks.Icon(options); return new bricks.Icon(options);
}); });
bricks.add_ViewBuilder('code', function(opts){
var textField = opts.textField || 'text';
var valueField = opts.name;
var txt = opts.useer_data[textField] || opts.user_data[valueField]||'';
var options = bricks.extend({}, opts);
options.otext = txt;
options.i18n = True;
return new bricks.Text(options);
});
bricks.add_ViewBuilder('password', function(opts){
var options = bricks.extend({}, opts);
options.otext = '******';
options.i18n = True;
return new bricks.Text(options);
});
bricks.add_ViewBuilder('hide', function(opts){
return new bricks.JsWidget({});
});
bricks.add_ViewBuilder('audio', function(opts){
var options = bricks.extend({}, opts);
var url = options.value;
return new bricks.AudioPlayer({url:url,autoplay:false});
});