2014-12-11 4 views
0

다음 스크립트는 내용이 저장되고 편집기가 열려있는 상태를 제외하고는 완벽하게 작동합니다. save_onsavecallback 콜백에서 TinyMCE 편집기를 닫으려면 어떻게해야합니까?save_onsavecallback 콜백시 TinyMCE 편집기 닫기

tinymce.init({ 
    selector: "#document", 
    inline: true, 
    plugins: ["advlist lists print preview anchor paste save"], 
    save_enablewhendirty: true, 
    save_onsavecallback: function() { 
     $.post('index.php?cid=stuff2fix',{task:"save",document:$("#document").html(),CSRF:$('#CSRF').val()}); 
     //CLOSE EDITOR NOW 
    }, 
    toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | save" 
}); 

답변

0

제거 할 mce 인스턴스를 확인한 다음 인스턴스에서 .remove()를 호출해야합니다. 저장을 클릭하면 주석을 제거하도록 코드를 수정했습니다.

http://www.tinymce.com/forum/viewtopic.php?id=9175

tinymce.init({ selector: "#document", inline: true, plugins: ["advlist lists print preview anchor paste save"], save_enablewhendirty: true, save_onsavecallback: function(inst) { $.post('index.php?cid=stuff2fix',{task:"save",document:$("#document").html(),CSRF:$('#CSRF').val()}); inst.remove(); }, toolbar: "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | save" });

이었다 도움 사이트
관련 문제