reset comment box height after posting a comment
refactor create comment method
This commit is contained in:
parent
43f21d6e55
commit
18aeeb052b
3 changed files with 10 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
## 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)
|
||||
* avoid posting empty comments. [#3836](https://github.com/diaspora/diaspora/issues/3836)
|
||||
* Delegate parent_author to the target of a RelayableRetraction
|
||||
|
|
|
|||
|
|
@ -41,12 +41,13 @@ app.views.CommentStream = app.views.Base.extend({
|
|||
if(evt){ evt.preventDefault(); }
|
||||
|
||||
var commentText = $.trim(this.$('.comment_box').val());
|
||||
this.$(".comment_box").val("");
|
||||
this.$(".comment_box").css("height", "");
|
||||
if(commentText) {
|
||||
this.model.comment(commentText);
|
||||
this.$(".comment_box").val("");
|
||||
return this;
|
||||
} else {
|
||||
this.$(".comment_box").val("").focus();
|
||||
this.$(".comment_box").focus();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@ describe("app.views.CommentStream", function(){
|
|||
this.view.createComment();
|
||||
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(){
|
||||
|
|
|
|||
Loading…
Reference in a new issue