var element = CKEDITOR.document.getById( 'myElement' );
element.on( 'click', function( ev ) {
someFunction();
});
Instead of :
var element = CKEDITOR.document.getById( 'myElement' );
element.on( 'click', function( ev )
{
// Prevent the click to chave any effect in the element.
ev.data.preventDefault();
});
If you want the click event to happen and your function to run as well, instead of preventing what would normally happen when the click is made and only your function is run.
Use :
var element = CKEDITOR.document.getById( 'myElement' );
element.on( 'click', function( ev ) {
ev.removeListener();
someFunction();
});
If you only want to listen to the event the very first time the element is clicked on, instead of every time the element is clicked.
I am trying to implement your solution for the main text area when the user clicks within it. However I need to find the
'myElement'
name. What is the id of the main text area for the control. When I try this using the name of the control, mine is CKEditor1, I am not getting a click event. The following is my control defined in the markup.
Re: capture onclick event handler to CKEditor textarea
I guess you could use :
Instead of :
If you want the click event to happen and your function to run as well, instead of preventing what would normally happen when the click is made and only your function is run.
Use :
If you only want to listen to the event the very first time the element is clicked on, instead of every time the element is clicked.
Thanks,
Zanpakutō
I am trying to implement your
I am trying to implement your solution for the main text area when the user clicks within it. However I need to find the
name. What is the id of the main text area for the control. When I try this using the name of the control, mine is CKEditor1, I am not getting a click event. The following is my control defined in the markup.