1

There is a conflict between Ember.JS and CKEDITOR. The toolbar (modal windows) doesn't work if I am using Ember.js. If I try to push e.g. the paste button then I get the following error message and the window is whited out with no modal window.

Uncaught TypeError: Cannot read property 'type' of undefined

ckeditor toolbar not working

If I remove Ember.Js then CKeditor works fine.

See a live demo of the problem on jsfiddle http://jsfiddle.net/HEhMq/13/

This is how I'm embedding the CKEDITOR to my ember templates:

App.HTMLTextArea = Ember.TextArea.extend({
    didInsertElement: function() {
        this._super();
        var self = this;
        var elementId = self.get('elementId');

        var edit = CKEDITOR.replace( elementId, {
            extraPlugins : 'autogrow',
            autoGrow_maxHeight : 800,
            // Remove the Resize plugin as it does not make sense to use it in conjunction with the AutoGrow plugin.
            removePlugins : 'resize'
        });

        edit.on('blur', function(e) {
                if (e.editor.checkDirty()) {
                        self.set('value', edit.getData() );
                }
        });
    }
});

With this code the editor loads up fine and the Ember values are updated. It's just the toolbar buttons that are not working.

Anybody had the same problem?

4

1 回答 1

6

Luckily, it turns out that we've already fixed this issue: http://dev.ckeditor.com/ticket/10265 We did that just few days ago and new version (4.1.1) which is planned for next week will contain this patch. In fact, master on CKEditor repo is already frozen for the release, so you can use it because it's very unlikely that something is going to change.

于 2013-04-17T19:56:22.560 回答