Reputation: 19
I am using CKEditor, I have put a link into a text. Is it possible to go directly to the link when we click (once) on that link inside CKEditor?
Upvotes: 1
Views: 2119
Reputation: 835
CKEDITOR.on('instanceReady', function (ev) {
$('iframe').contents().click(function (e) {
if (typeof e.target.href !== 'undefined') {
window.open(e.target.href, 'new' + e.screenX);
} else if (typeof e.currentTarget.activeElement.href !== 'undefined') {
window.open(e.currentTarget.activeElement.href, 'new' + e.screenX);
}
});
});
Upvotes: 0
Reputation: 386
Have you tried something like this (jQuery required):
CKEDITOR.on('instanceReady', function(ev) {
$('iframe').contents().click(function(e) {
if(typeof e.target.href != 'undefined') {
window.open(e.target.href, 'new' + e.screenX);
}
});
});
hotfix from https://dev.ckeditor.com/ticket/7145#comment:1
Upvotes: 1