parent
9d2d20e854
commit
d4bdb2fcb4
2 changed files with 6 additions and 1 deletions
|
|
@ -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() {
|
||||||
|
|
||||||
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() {
|
||||||
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() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue