diaspora/public/javascripts/widgets/comment-form.js
2011-08-31 17:13:24 -05:00

22 lines
No EOL
594 B
JavaScript

(function() {
var CommentForm = function() {
var self = this;
this.subscribe("widget/ready", function(evt, commentFormElement) {
$.extend(self, {
commentFormElement: commentFormElement,
commentInput: commentFormElement.find("textarea")
});
self.commentInput.autoResize();
self.commentInput.focus(self.showCommentForm);
});
this.showCommentForm = function() {
self.commentFormElement.parent().removeClass("hidden");
self.commentFormElement.addClass("open");
};
};
Diaspora.Widgets.CommentForm = CommentForm;
})();