-
Notifications
You must be signed in to change notification settings - Fork 1
/
header_view.js
49 lines (42 loc) · 860 Bytes
/
header_view.js
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
41
42
43
44
45
46
47
48
49
YUI.add('cweepy:views:header', function (Y) {
Y.namespace('Cweepy').HeaderView = Y.Base.create('cweepy:headerView',
Y.View,
[],
{
events: {
'.add-cweep': { click: 'showAddCweep' }
},
template: Y.Handlebars.compile(
Y.one('#cweepy-header-tmpl').getContent()
),
render: function () {
this.get('container').setContent(
this.template()
);
return this;
},
showAddCweep: function () {
this.get('container').append(
this.get('addCweepView').render().get('container')
);
}
},
{
ATTRS: {
addCweepView: {
valueFn: function () {
return new Y.Cweepy.AddCweepView({
modelList: this.get('modelList')
});
}
}
}
});
},
'0.0.1',
{
requires: [
'view',
'cweepy:views:add_cweep'
]
});