Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TinyMCE editor lost the focus of input box on popup dialog

When I try to open the TinyMCE editor within a dialog box popup and click on "Insert link", the dialog box popup appears for "Insert link" but I am unable to write in the text field for "Insert link".

As far I know, the problem has to do with a dialog box open in another dialog box. Has anyone found a way around it?

like image 453
user2972061 Avatar asked Nov 09 '13 14:11

user2972061


2 Answers

I found the answer :)

$(document).on('focusin', function(e) {
    if ($(e.target).closest(".mce-window").length) {
        e.stopImmediatePropagation();
    }
});

just paste the above code and focus will bbe automatically on last dialog box of TinyMCE.

like image 85
user2972061 Avatar answered Nov 18 '22 13:11

user2972061


i got another trick to solve that.. thanks to tyemmcee, see bug: http://www.tinymce.com/develop/bugtracker_view.php?id=5917

  $.widget("ui.dialog", $.ui.dialog, {
    _allowInteraction: function(event) {
        return !!$(event.target).closest(".mce-container").length || this._super( event );
        }
    });

see tinymce fiddle: http://fiddle.tinymce.com/lpdaab/2

like image 26
thomi_ch Avatar answered Nov 18 '22 11:11

thomi_ch