Created
October 15, 2015 10:14
-
-
Save mlewand/0251b6add54b02e20325 to your computer and use it in GitHub Desktop.
An example how one might add custom file browsing handler for CKEditor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CKEDITOR.replace( 'editor', { | |
on: { | |
// You need to listen to dialogShow event. | |
dialogShow: function( evt ) { | |
// Getting browse button object. | |
var browseButton = evt.data.getContentElement( 'info', 'browse' ); | |
if ( browseButton ) { | |
browseButton.on( 'click', function( evt ) { | |
// Do your custom logic here, e.g. display a floating div with UI. | |
evt.stop(); // Stop the event if you want nothing more to happen. | |
}, null, null, 9 ); | |
} | |
} | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment