Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Solved] Draft is saved, content disappears

solvesolve New
edited October 2012 in Vanilla 2.0 - 2.8

Hi,

I have a problem with this plugin. Unfortunately every time a draft is saved, the whole content in the box disappears. However, once I go specifically to my profile section "My Draft" I can find everything that just disappeared. Once I continue to edit the text, the same problem happens again.

This is on Version 2.1a26 / v. 1.04

Comments

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited October 2012

    Hiya,

    I know what's causing this. In 1.0.4, I implemented a rather silly mechanism for clearing the content of the editor on form submission which has now backfired. To fix it, delete these lines of code from initialize.js:

    $(".MessageForm form, .DiscussionForm form").submit(function() {
        $(this).find("textarea").data("wysihtml5").editor.clear();
    });
    

    @Todd: Would you perhaps know how to use the CommentAdded trigger?

    Edit: Figured it out, sorry for mentioning you Todd without giving it some thought first! Replace the above with this instead (I'll upload 1.0.5 soon):

    jQuery(document).bind("CommentAdded", function() {
        $("#Form_Body").data("wysihtml5").editor.clear();
    });
    

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • KasperKasper Scholar of the Bits Copenhagen Vanilla Staff
    edited October 2012

    Alrighty, this has been fixed as of 1.0.5 http://vanillaforums.org/addon/wysihtml5-plugin-1.0.5

    Kasper Kronborg Isager (kasperisager) | Freelance Developer @Vanilla | Hit me up: Google Mail or Vanilla Mail | Find me on GitHub

  • Awesome. I really appreciate how fast the development of this plugin is happening.

This discussion has been closed.