开发者

ckEditor - mouseup event not firing after setData

I have a ckEditor loaded through Javascript, then on the instanceReady event I add another event for mouseup... this works well and dandy until I use the setText property (I used both the jQuery way and the Javascript way). After that is set, the mouseup event no longer triggers. Not even after I set the event handler again.

Relevant code:

var elem = CKEDITOR.instances[eID];
elem.document.on("mouseup"开发者_运维技巧,function(){
            QuickHandler(elem);
        });



function QuickHandler(who)
{

    $("#"+who.name).val(who.getData() +    QuickTextSelected.QuickTextData);
       $("input[type='text'],textarea, .cke_contents").css({border: "Solid 1px rgb(155,181,234)"}).unbind("click");
    

}

This is the jQuery plugin version, but it works the same way with the internal Javascript ckeditor object map. (Rather it doesn't work).

Does setData or setText clear all event handlers?


It seems that by using setData CKEditor infact replaces the document element rendering your events invalid, see #6633

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜