forked from fanruan/fineui-start
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
2.4 KiB
61 lines
2.4 KiB
6 years ago
|
!(function () {
|
||
|
var ToDoListHeader = BI.inherit(BI.Widget, {
|
||
|
|
||
|
props: {
|
||
|
baseCls: "my-todolist-header"
|
||
|
},
|
||
|
|
||
|
render: function () {
|
||
|
var self = this, o = this.options;
|
||
|
return {
|
||
|
type: "bi.horizontal_auto",
|
||
|
items: [
|
||
|
{
|
||
|
el: {
|
||
|
type: "bi.left_right_vertical_adapt",
|
||
|
width: 600,
|
||
|
height: o.height,
|
||
|
items: {
|
||
|
left: [
|
||
|
{
|
||
|
el: {
|
||
|
type: "bi.label",
|
||
|
cls: "my-todolist-title",
|
||
|
text: "FineUI ToDoList",
|
||
|
height: o.height
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
right: [
|
||
|
{
|
||
|
el: {
|
||
|
type: "bi.editor",
|
||
|
allowBlank: true,
|
||
|
cls: "my-todolist-header-editor",
|
||
|
watermark: "添加ToDo",
|
||
|
width: 300,
|
||
|
height: 24,
|
||
|
listeners: [
|
||
|
{
|
||
|
eventName: "EVENT_ENTER",
|
||
|
action: function () {
|
||
|
self.fireEvent(ToDoListHeader.EVENT_ADD, this.getValue());
|
||
|
this.setValue("");
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
};
|
||
|
}
|
||
|
});
|
||
|
|
||
|
ToDoListHeader.EVENT_ADD = "EVENT_ADD";
|
||
|
|
||
|
BI.shortcut("my.todolist.header", ToDoListHeader);
|
||
|
})();
|