Ember.JS と CKEDITOR の間に競合があります。Ember.js を使用している場合、ツールバー (モーダル ウィンドウ) が機能しません。貼り付けボタンなどを押そうとすると、次のエラー メッセージが表示され、ウィンドウが白く表示され、モーダル ウィンドウが表示されません。
Uncaught TypeError: Cannot read property 'type' of undefined
Ember.Js を削除すると、CKeditor は正常に動作します。
jsfiddle http://jsfiddle.net/HEhMq/13/で問題のライブ デモを参照してください。
これは、CKEDITOR を ember テンプレートに埋め込む方法です。
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() );
}
});
}
});
このコードを使用すると、エディターが正常に読み込まれ、Ember の値が更新されます。機能していないのはツールバーのボタンだけです。
誰かが同じ問題を抱えていましたか?