Compare commits
No commits in common. "be1f1ebd1d1724c16dfb25436cae3abceae94de7" and "638e629cf14f1927b1094493ba7b98339e8421a1" have entirely different histories.
be1f1ebd1d
...
638e629cf1
@ -90,8 +90,8 @@ bricks.widgetBuild = async function(desc, widget){
|
||||
console.log('widgetBuild():',desc.widgettype, 'not registered', bricks.Factory.widgets_kw);
|
||||
return null;
|
||||
}
|
||||
desc.options.baseURI = base_url;
|
||||
var options = desc.options || {};
|
||||
options.baseURI = base_url;
|
||||
let w = new klass(options);
|
||||
if (desc.id){
|
||||
w.set_id(desc.id);
|
||||
|
@ -7,16 +7,17 @@ bricks.Layout = class extends bricks.JsWidget {
|
||||
}
|
||||
|
||||
add_widget(w, index){
|
||||
if (index >=0 && index < this.children.length){
|
||||
var pos_w = this.children[index];
|
||||
this.dom_element.insertBefore(w.dom_element, pos_w.dom_element);
|
||||
this.children.insert(index+1, w);
|
||||
} else {
|
||||
if (! index || index>=this.children.length){
|
||||
// append child at end
|
||||
w.parent = this;
|
||||
this.children.push(w);
|
||||
this.dom_element.appendChild(w.dom_element);
|
||||
return
|
||||
}
|
||||
// insert to where index point out
|
||||
var pos_w = this.children[index];
|
||||
this.dom_element.insertBefore(w.dom_element, pos_w.dom_element);
|
||||
this.children.insert(index+1, w);
|
||||
w.dispatch('on_parent', this);
|
||||
}
|
||||
remove_widgets_at_begin(cnt){
|
||||
|
@ -1,67 +0,0 @@
|
||||
{
|
||||
"widgettype":"VBox",
|
||||
"options":{
|
||||
"width":"100%",
|
||||
"height":"100%"
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
"widgettype":"HBox",
|
||||
"options":{
|
||||
"height":"40px"
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
"id":"insert",
|
||||
"widgettype":"Button",
|
||||
"options":{
|
||||
"width":"80px",
|
||||
"i18n":true,
|
||||
"label":"insert"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id":"append",
|
||||
"widgettype":"Button",
|
||||
"options":{
|
||||
"width":"80px",
|
||||
"i18n":true,
|
||||
"label":"append"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id":"main",
|
||||
"widgettype":"Filler"
|
||||
}
|
||||
],
|
||||
"binds":[
|
||||
{
|
||||
"wid":"insert",
|
||||
"event":"click",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"main",
|
||||
"options":{
|
||||
"url":"{{entire_url('subtext.ui')}}",
|
||||
"params":{
|
||||
"text":"Insert before"
|
||||
}
|
||||
},
|
||||
"mode":"insert"
|
||||
},
|
||||
{
|
||||
"wid":"append",
|
||||
"event":"click",
|
||||
"actiontype":"urlwidget",
|
||||
"target":"main",
|
||||
"options":{
|
||||
"url":"{{entire_url('subtext.ui')}}",
|
||||
"params":{
|
||||
"text":"Append After"
|
||||
}
|
||||
},
|
||||
"mode":"append"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
{
|
||||
"widgettype":"Text",
|
||||
"options":{
|
||||
"text":"{{params_kw.get('text') or 'default text'}}"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user