Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider 43bdebca rédigé par Benjamin Neff's avatar Benjamin Neff
Parcourir les fichiers

Merge pull request #7522 from svbergerem/fix-autosize-comments-conversations

Call autosize when changing input via markdown editor
parents 757a5fbd d4bdb2fc
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -9,7 +9,8 @@ Diaspora.MarkdownEditor.prototype = { ...@@ -9,7 +9,8 @@ Diaspora.MarkdownEditor.prototype = {
this.options = { this.options = {
resize: "none", resize: "none",
onHidePreview: $.noop, onHidePreview: $.noop,
onPostPreview: $.noop onPostPreview: $.noop,
onChange: function(e) { autosize.update(e.$textarea); }
}; };
$.extend(this.options, opts); $.extend(this.options, opts);
......
...@@ -31,6 +31,7 @@ describe("Diaspora.MarkdownEditor", function() { ...@@ -31,6 +31,7 @@ describe("Diaspora.MarkdownEditor", function() {
it("call $.fn.markdown with correct default options", function() { it("call $.fn.markdown with correct default options", function() {
spyOn($.fn, "markdown"); spyOn($.fn, "markdown");
spyOn(autosize, "update");
this.target.initialize(this.$el, {}); this.target.initialize(this.$el, {});
expect($.fn.markdown).toHaveBeenCalled(); expect($.fn.markdown).toHaveBeenCalled();
var args = $.fn.markdown.calls.mostRecent().args[0]; var args = $.fn.markdown.calls.mostRecent().args[0];
...@@ -40,6 +41,9 @@ describe("Diaspora.MarkdownEditor", function() { ...@@ -40,6 +41,9 @@ describe("Diaspora.MarkdownEditor", function() {
expect(args.onPostPreview).toBe($.noop); expect(args.onPostPreview).toBe($.noop);
expect(args.fullscreen).toEqual({enable: false, icons: {}}); expect(args.fullscreen).toEqual({enable: false, icons: {}});
expect(args.hiddenButtons).toEqual(["cmdPreview"]); expect(args.hiddenButtons).toEqual(["cmdPreview"]);
args.onChange({$textarea: "el"});
expect(autosize.update).toHaveBeenCalledWith("el");
}); });
it("overrides fullscreen, hiddenButtons, language and onShow options", function() { it("overrides fullscreen, hiddenButtons, language and onShow options", function() {
......
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