diff --git a/bricks/css/bricks.css b/bricks/css/bricks.css index f69b893..6b093e4 100755 --- a/bricks/css/bricks.css +++ b/bricks/css/bricks.css @@ -180,7 +180,7 @@ body { } .inputbox { - background-color: #ddd; + background-color: #f8f8f8; border: 1px solid #ccc; padding: 10px; margin: 0 0 1em 0; diff --git a/bricks/form.js b/bricks/form.js index e4f1ae7..39b63fa 100644 --- a/bricks/form.js +++ b/bricks/form.js @@ -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)); box.add_widget(new bricks.Filler()); box.add_widget(tbw); diff --git a/bricks/input.js b/bricks/input.js index e2c1837..2a16e9e 100755 --- a/bricks/input.js +++ b/bricks/input.js @@ -120,7 +120,6 @@ bricks.UiStr =class extends bricks.UiType { this.dom_element.style.width = opts.width; } this.charsize_sizing(); - } create(){ var el = this._create('input'); @@ -147,8 +146,8 @@ bricks.UiStr =class extends bricks.UiType { if (this.opts.defaultVlaue) el.defaultValue = this.opts.defaultValue; this.reset() - if (this.opts.tip) - el.placeholder = bricks.app.i18n._(this.opts.tip); + if (this.opts.placeholder) + el.placeholder = bricks.app.i18n._(this.opts.placeholder); el.addEventListener('focus', this.onfocus.bind(this)); el.addEventListener('onkeydown', this.onkeydown.bind(this)); el.addEventListener('blur', this.onblur.bind(this)); diff --git a/examples/form.ui b/examples/form.ui index 4e6d9be..7b696f5 100644 --- a/examples/form.ui +++ b/examples/form.ui @@ -56,7 +56,7 @@ { "widgettype":"Form", "options":{ - "submit_url":"/ttt/ttt.dspy", + "submit_url":"{{entire_url('ttt.dspy')}}", "title":"Test hahah Form", "description":"test input implemented", "fields":[ diff --git a/examples/tt.dspy b/examples/tt.dspy new file mode 100644 index 0000000..1c9a437 --- /dev/null +++ b/examples/tt.dspy @@ -0,0 +1,8 @@ +info(params_kw) +return { + "widgettype":"Message", + "options":{ + "title":"form data accepted", + "message":json.dumps(params_kw) + } +} diff --git a/examples/ttt.dspy b/examples/ttt.dspy new file mode 100644 index 0000000..1c9a437 --- /dev/null +++ b/examples/ttt.dspy @@ -0,0 +1,8 @@ +info(params_kw) +return { + "widgettype":"Message", + "options":{ + "title":"form data accepted", + "message":json.dumps(params_kw) + } +}