Merge pull request #4036 from pestrada/4030-resize-textarea-after-commenting

reset comment box height after posting a comment
This commit is contained in:
Jonne Haß 2013-03-07 12:12:59 -08:00
commit 20484fd3dd
3 changed files with 10 additions and 2 deletions

View file

@ -2,6 +2,7 @@
## Bug fixes ## Bug fixes
* reset comment box height after posting a comment. [#4030](https://github.com/diaspora/diaspora/issues/4030)
* fade long tag names. [#3899](https://github.com/diaspora/diaspora/issues/3899) * fade long tag names. [#3899](https://github.com/diaspora/diaspora/issues/3899)
* avoid posting empty comments. [#3836](https://github.com/diaspora/diaspora/issues/3836) * avoid posting empty comments. [#3836](https://github.com/diaspora/diaspora/issues/3836)
* Delegate parent_author to the target of a RelayableRetraction * Delegate parent_author to the target of a RelayableRetraction

View file

@ -41,12 +41,13 @@ app.views.CommentStream = app.views.Base.extend({
if(evt){ evt.preventDefault(); } if(evt){ evt.preventDefault(); }
var commentText = $.trim(this.$('.comment_box').val()); var commentText = $.trim(this.$('.comment_box').val());
this.$(".comment_box").val("");
this.$(".comment_box").css("height", "");
if(commentText) { if(commentText) {
this.model.comment(commentText); this.model.comment(commentText);
this.$(".comment_box").val("");
return this; return this;
} else { } else {
this.$(".comment_box").val("").focus(); this.$(".comment_box").focus();
} }
}, },

View file

@ -47,6 +47,12 @@ describe("app.views.CommentStream", function(){
this.view.createComment(); this.view.createComment();
expect(this.view.$(".comment_box").val()).toEqual(""); expect(this.view.$(".comment_box").val()).toEqual("");
}) })
it("resets comment box height", function() {
this.view.$(".comment_box").val('a new comment');
this.view.createComment();
expect(this.view.$(".comment_box").attr("style")).not.toContain("height");
})
}) })
describe("appendComment", function(){ describe("appendComment", function(){