2016-11-23 13 views
0

インラインモードのTinyMCEプラグインを使用しています。私がしたいことは、エディタが閉じられた後に編集された領域の内容を取得することです。これは今私が持っているものです:TinyMCEインラインモード:エディタの編集エリアの内容を閉じる

tinymce.init({ 
    selector: '.editable', 
    plugins: "link", 
    inline: true, 
    init_instance_callback: function (editor) { 
     editor.on('GetContent', function (e) { 
     console.log(e.content); 
     }); 
    } 
    }); 

しかし、これは何も記録しません。何か案は?

答えて

0

あなたはそれがblurイベント(https://www.tinymce.com/docs/advanced/events/#blur)を発射...そして、あなたのTinyMCEの設定でこれをキャプチャすることができますエディタを終了するたび:

tinymce.init({ 
    selector: '#my_div", 
    ... 
    setup: function (editor) { 
     editor.on('blur', function (e) { 
      console.log('Editor was blurred!'); 
      // Do what you want when the editor is blurred here 
      console.log(editor.getContent()); //get the content from the editor 
     }); 
    } 
}); 
関連する問題