trsteel88 / TrsteelCkeditorBundle

Symfony2 bundle for easy integration of the CKEditor WYSIWYG
97 stars 59 forks source link

Can`t type in windows dialog (JQuery) #75

Closed Luvelnet closed 10 years ago

Luvelnet commented 10 years ago

I try created a form into windows dialog of Jquery, but when open the windows to type in the Editor, it don't allow myself. Why?

trsteel88 commented 10 years ago

Can you please supply sample code and further explanation so I can replicate.

Luvelnet commented 10 years ago

Ok, the dialog windows:

$(function() { $( "#intervention_form" ).dialog({ autoOpen: false, modal: true, resizable: false, draggable: true, width: 900, height: 600, dialogClass:'noTitleStuff', show: { effect: "puff", duration: 300 }, hide: { effect: "puff", duration: 300 } }); });

The form:

public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('intervention','ckeditor') ->add('sources'); }

The form is into #intervention_form DIV (dialog windows), then if you click to open the dialog windows and you try to type in the editor, doesn´t work.

Do you need anything else?

Thanks!

Luvelnet commented 10 years ago

Did you see anything?

Thanks!

trsteel88 commented 10 years ago

@Luvelnet this isn't related to the bundle. When you open the dialog you are actually moving the CKEditor elements. This means you need the refresh the instance.

Eg, if you destroy it, you will see the textarea. You would need to then reinitiate the editor. You will have to look around for this as I haven't had to do this before.

...
hide: {
    effect: "puff",
    duration: 300
},
open: function (event, ui) {
    for(var instanceName in CKEDITOR.instances) {
        CKEDITOR.instances[instanceName].destroy();
    }
}