From dc1bc753039c7435149afee029c039ff9f8b45a2 Mon Sep 17 00:00:00 2001 From: Steffen van Bergerem Date: Mon, 12 Sep 2016 19:53:33 +0200 Subject: [PATCH] Fix moving publisher on first click after page load closes #7094 fixes #7093 --- Changelog.md | 1 + app/assets/javascripts/app/views/publisher_view.js | 1 + spec/javascripts/app/views/publisher_view_spec.js | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/Changelog.md b/Changelog.md index a24768cb5..034bda5a8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -19,6 +19,7 @@ * Fix 500 in html requests for post interactions [#7085](https://github.com/diaspora/diaspora/pull/7085) * Remove whitespaces next to like link in stream [#7088](https://github.com/diaspora/diaspora/pull/7088) * Prevent overflow of interaction avatars in the single post view [#7070](https://github.com/diaspora/diaspora/pull/7070) +* Fix moving publisher on first click after page load [#7094](https://github.com/diaspora/diaspora/pull/7094) ## Features * Deleted comments will be removed when loading more comments [#7045](https://github.com/diaspora/diaspora/pull/7045) diff --git a/app/assets/javascripts/app/views/publisher_view.js b/app/assets/javascripts/app/views/publisher_view.js index 95aab180a..1b9f2f56c 100644 --- a/app/assets/javascripts/app/views/publisher_view.js +++ b/app/assets/javascripts/app/views/publisher_view.js @@ -443,6 +443,7 @@ app.views.Publisher = Backbone.View.extend({ $(this.el).addClass("closed"); this.wrapperEl.removeClass("active"); this.inputEl.css("height", ""); + autosize.update(this.inputEl); this.wrapperEl.removeClass("with-poll"); return this; }, diff --git a/spec/javascripts/app/views/publisher_view_spec.js b/spec/javascripts/app/views/publisher_view_spec.js index 47e552f3c..fb527b186 100644 --- a/spec/javascripts/app/views/publisher_view_spec.js +++ b/spec/javascripts/app/views/publisher_view_spec.js @@ -87,6 +87,12 @@ describe("app.views.Publisher", function() { expect($(this.view.el).find("#status_message_fake_text").attr("style")).not.toContain("height"); }); + it("calls autosize.update", function() { + spyOn(autosize, "update"); + this.view.close($.Event()); + expect(autosize.update).toHaveBeenCalledWith(this.view.inputEl); + }); + it("should hide the poll container correctly", function() { this.view.$el.find(".poll-creator").click(); expect(this.view.$el.find(".publisher-textarea-wrapper")).toHaveClass("with-poll");