This commit is contained in:
yumoqing 2024-03-27 13:13:18 +08:00
parent e459801466
commit 041bd64294
6 changed files with 21 additions and 6 deletions

View File

@ -180,7 +180,7 @@ body {
} }
.inputbox { .inputbox {
background-color: #ddd; background-color: #f8f8f8;
border: 1px solid #ccc; border: 1px solid #ccc;
padding: 10px; padding: 10px;
margin: 0 0 1em 0; margin: 0 0 1em 0;

View File

@ -141,7 +141,7 @@ bricks.Form = class extends bricks.VBox {
} }
] ]
}; };
var tbw = new bricks.Toolbar(tb_desc); var tbw = new bricks.IconTextBar(tb_desc);
tbw.bind('command', this.command_handle.bind(this)); tbw.bind('command', this.command_handle.bind(this));
box.add_widget(new bricks.Filler()); box.add_widget(new bricks.Filler());
box.add_widget(tbw); box.add_widget(tbw);

View File

@ -120,7 +120,6 @@ bricks.UiStr =class extends bricks.UiType {
this.dom_element.style.width = opts.width; this.dom_element.style.width = opts.width;
} }
this.charsize_sizing(); this.charsize_sizing();
} }
create(){ create(){
var el = this._create('input'); var el = this._create('input');
@ -147,8 +146,8 @@ bricks.UiStr =class extends bricks.UiType {
if (this.opts.defaultVlaue) if (this.opts.defaultVlaue)
el.defaultValue = this.opts.defaultValue; el.defaultValue = this.opts.defaultValue;
this.reset() this.reset()
if (this.opts.tip) if (this.opts.placeholder)
el.placeholder = bricks.app.i18n._(this.opts.tip); el.placeholder = bricks.app.i18n._(this.opts.placeholder);
el.addEventListener('focus', this.onfocus.bind(this)); el.addEventListener('focus', this.onfocus.bind(this));
el.addEventListener('onkeydown', this.onkeydown.bind(this)); el.addEventListener('onkeydown', this.onkeydown.bind(this));
el.addEventListener('blur', this.onblur.bind(this)); el.addEventListener('blur', this.onblur.bind(this));

View File

@ -56,7 +56,7 @@
{ {
"widgettype":"Form", "widgettype":"Form",
"options":{ "options":{
"submit_url":"/ttt/ttt.dspy", "submit_url":"{{entire_url('ttt.dspy')}}",
"title":"Test hahah Form", "title":"Test hahah Form",
"description":"test input implemented", "description":"test input implemented",
"fields":[ "fields":[

8
examples/tt.dspy Normal file
View File

@ -0,0 +1,8 @@
info(params_kw)
return {
"widgettype":"Message",
"options":{
"title":"form data accepted",
"message":json.dumps(params_kw)
}
}

8
examples/ttt.dspy Normal file
View File

@ -0,0 +1,8 @@
info(params_kw)
return {
"widgettype":"Message",
"options":{
"title":"form data accepted",
"message":json.dumps(params_kw)
}
}