Merge pull request #3086 from Raven24/fix-publisher-height

reset publisher css height when "cleared" [ci skip]
This commit is contained in:
Daniel Grippi 2012-04-01 18:24:00 -07:00
commit a45eed13d5
2 changed files with 11 additions and 5 deletions

View file

@ -68,7 +68,7 @@ app.views.Publisher = Backbone.View.extend({
open : function() {
$(this.el).removeClass('closed');
this.$("#publisher_textarea_wrapper").addClass('active');
this.$("textarea.ac_input").css('min-height', '42px');
this.$("textarea").css('height', '42px');
return this;
},
@ -76,7 +76,7 @@ app.views.Publisher = Backbone.View.extend({
close : function() {
$(this.el).addClass("closed");
this.$("#publisher_textarea_wrapper").removeClass("active");
this.$("textarea.ac_input").css('min-height', '');
this.$("textarea").css('height', '');
return this;
}

View file

@ -16,13 +16,19 @@ describe("app.views.Publisher", function() {
});
describe("#close", function() {
it("removes the 'active' class from the publisher element", function(){
$(this.view.el).removeClass("closed");
beforeEach(function() {
this.view.open($.Event());
});
expect($(this.view.el)).not.toHaveClass("closed");
it("removes the 'active' class from the publisher element", function(){
this.view.close($.Event());
expect($(this.view.el)).toHaveClass("closed");
})
it("resets the element's height", function() {
this.view.close($.Event());
expect($(this.view.el).find("#status_message_fake_text").attr("style")).not.toContain("height");
});
});
describe("#clear", function() {