我正在構建一個需要用戶將html元素拖放到CKeditor實例上的應用程序。我需要監聽放置事件,以便我可以採取措施移除放入編輯器的元素。我看到有一個'粘貼'事件,但它不是由放置引發的。如何在CKeditor中監聽拖放事件?
這裏是我的簡單測試,使用jQuery的CKEDITOR適配器:
// set up instance
$('#editor1').ckeditor();
var editor = $('#editor1').ckeditorGet();
// this gets a list of all events that you can listen for
console.log(editor._.events);
// here's how you listen for an event
editor.on("someEvent", function(e) {
console.log(e);
});
我不能找到文檔中任何對這個線索。
任何想法?
你有這個運氣好的話,最近拖動的元素?我現在正在嘗試做同樣的事情。 – joshs 2011-01-15 05:57:18
不,沒有運氣。我走了一條不同的道路。 – ScottE 2011-01-15 13:18:45