Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 8f449850 rédigé par cmrd Senya's avatar cmrd Senya
Parcourir les fichiers

Fix autosize for the textarea in conversations

We need to reinit autosize when we navigate in conversations with the backbone router.
parent 7b711254
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -24,6 +24,7 @@ app.views.ConversationsInbox = app.views.Base.extend({
self.selectConversation(conversationId);
self.setupConversation();
self.conversationForm.renderMarkdownEditor("#conversation-show .conversation-message-text");
autosize(self.$("#conversation-show textarea"));
}
});
},
......
......@@ -35,6 +35,7 @@ describe("app.views.ConversationsInbox", function() {
spyOn(app.views.ConversationsInbox.prototype, "selectConversation");
spyOn(app.views.ConversationsInbox.prototype, "setupConversation");
spyOn(app.views.ConversationsForm.prototype, "renderMarkdownEditor");
spyOn(window, "autosize");
this.target.renderConversation(this.conversationId);
jasmine.Ajax.requests.mostRecent().respondWith({
status: 200,
......@@ -46,6 +47,8 @@ describe("app.views.ConversationsInbox", function() {
expect(app.views.ConversationsInbox.prototype.selectConversation).toHaveBeenCalledWith(this.conversationId);
expect(app.views.ConversationsInbox.prototype.setupConversation).toHaveBeenCalled();
expect(app.views.ConversationsForm.prototype.renderMarkdownEditor).toHaveBeenCalled();
expect(window.autosize).toHaveBeenCalled();
expect(window.autosize.calls.mostRecent().args[0].is($("#conversation-show textarea")));
expect($("#conversation-new")).toHaveClass("hidden");
expect($("#conversation-show")).not.toHaveClass("hidden");
expect($("#conversation-show #fake-conversation-content").length).toBe(1);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter