lundi 13 avril 2015

Editing nested image in CKEditor widget doesn't work

I'm using my own plugin providing widgets for the CKEditor. I'm not able to edit images in editables.


It's no problem to add an image. The editor shows it.


But if I want to edit one, the dialog fields (like URL) are empty. I'm using the default image plugin (no image2 widget).


Is there something I have to do for supporting this feature?


I added an example of my plugin. I'm using it in a drupal web portal in combination with the drupal ckeditor module.



// Register our custom "section" widget plugin with CKEditor.
CKEDITOR.plugins.add('section', {
requires : 'widget',
init : function(editor) {


// Register the widget.
editor.widgets.add('example', {
template : '<section class="example"><div class="container-fluid"><div class="row"><div class="col-sm-12 col-md-6 editable-left"></div><div class="col-sm-6 col-md-3 text-center editable-middle"></div><div class="col-sm-6 col-md-3 editable-right"></div></div></div></section>',
allowedContent : 'section(!example)',
editables : {
left : {
selector : '.editable-left',
},
middle : {
selector : '.editable-middle',
},
right : {
selector : '.editable-right',
},
},
upcast : function(element) {
if (element.name == 'section' && element.hasClass('example')) {
return true;
} else {
return false;
}
}
});

}
});

Aucun commentaire:

Enregistrer un commentaire