1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
define.class('$ui/view', function(require, $$, dialog, $ui$, textbox, view, icon, treeview, cadgrid, label, button, $$, ballbutton){
this.bgcolor = vec4(0,0,0,0.5);
this.attributes = {
compositions: []
}
this.init = function(){
this.rpc.fileio.getCompositionList().then(function(ret){
this.compositions = ret.value.children[0].children;
}.bind(this))
}
this.render =function(){
var res = [];
for(var i =0 ;i<this.compositions.length;i++){
var c= this.compositions[i];
console.log(c);
res.push(button({text:c.name,name:c.name, margin:4, click:function(){this.screen.closeModal(this.name);}}));
}
return dialog({title:"Open composition", position:"relative"},
view({bgcolor:NaN, flexdirection:"column", padding:vec4(20,10,10,10) }
,res,
view({flexdirection:"row",bgcolor:NaN, alignitems: "flex-end", justifycontent:"flex-end", alignself:"flex-end" },
button({padding: 10, marginleft:10, icon:"close",text:"Cancel", click: function(){this.screen.closeModal(false);} })
)
)
);
}
})
|