TinyMCE source editor with inline editing

TinyMCE source editor with inline editing

john.morganjohn.morgan Posts: 4Questions: 0Answers: 0

I've been using the TinyMCE editor plug-in, and all is working well apart from one thing. I have inline editing enabled - admittedly not ideal as the TinyMCE editor is squashed into a tiny space, but it works, apart from the source editor.
If I bring the source editor up by clicking on the "<>" button, any click within this window closes it immediately. This only happens with inline editing - it works fine if I edit the whole row.
There are no errors or warnings in the console. I'm afraid I can't see how to construct an example in live.datatables.net using this plugin.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I hadn't tested it inline - apologies. For exactly the reason you stated, I had assumed it wouldn't be used that way. I should have known better :).

    Add:


    owns: function (conf, node) { return $(node).closest('div.DTE_Field_Type_tinymce').length ? true : false; },

    into the plug-in code and that should address the issue you are seeing.

    Regards,
    Allan

  • john.morganjohn.morgan Posts: 4Questions: 0Answers: 0

    Thanks Alan - I've added that in (below the destroy function), now I can type into the source editor although it doesn't seem to save what I've typed - I also get an NS_ERROR_UNEXPECTED: in the console as soon as I click in the editor window?

  • john.morganjohn.morgan Posts: 4Questions: 0Answers: 0

    Thanks Alan - I've added that in (below the destroy function), now I can type into the source editor although it doesn't seem to save what I've typed - I also get an NS_ERROR_UNEXPECTED: in the console as soon as I click in the editor window?

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Could you give me a link to your page so I can take a look and see what is going wrong please?

    Thanks,
    Allan

  • john.morganjohn.morgan Posts: 4Questions: 0Answers: 0

    Hi Allan,

    I had to modify the function slightly to:

    owns: function (conf, node) {
        return $(node).closest('div.DTE_Field_Type_tinymce').length || $(node).closest('.tox-tinymce-aux').length 
            ? true 
            : false;
    },
    

    now it works fine :) Thanks for your help!

This discussion has been closed.