First stab at enyo rewrite
[blerg.git] / www / jssrc / blerg / Post.js
1 enyo.kind({
2         name: "blerg.Post",
3         kind: "Control",
4         classes: "blerg-post",
5         components: [
6                 {tag: "h2", content: "What's on your mind?"},
7                 {kind: "onyx.InputDecorator", components: [
8                         {name: "postContent", classes: "content", kind: "onyx.TextArea", onkeydown: "resizePostContent"}
9                 ]},
10                 {classes: "buttons", components: [
11                         {kind: "onyx.Button", content: "Close", onclick: "closePost", classes: "onyx-negative"},
12                         {kind: "onyx.Button", content: "Post", onclick: "doPost", classes: "onyx-affirmative"}
13                 ]}
14         ],
15         getData: function() {
16                 return this.$.postContent.getValue();
17         },
18         setData: function(inVal) {
19                 this.$.postContent.setValue(inVal);
20         },
21         closePost: function() {
22                 this.hide();
23         },
24         doPost: function() {
25                 this.bubble('onPost', {data: this.getData()});
26         }
27 });