Created
April 10, 2014 06:42
-
-
Save jnowland/10348686 to your computer and use it in GitHub Desktop.
Enables Typekit to be embed inside of CK Editor Field.
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
var typkitID = 'XXXXXX'; | |
CKEDITOR.on( | |
'instanceReady', | |
function(ev) { | |
var $script = document.createElement('script'), | |
$editor_instance = CKEDITOR.instances[ev.editor.name]; | |
$script.src = '//use.typekit.com/'+typkitID+'.js'; | |
$script.onload = function() { | |
try{$editor_instance.window.$.Typekit.load();}catch(e){} | |
}; | |
$editor_instance.document.getHead().$.appendChild($script); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Remember to flush your browser cache after putting this in;) Thanks did the trick even with 4.x