Skip to content

Instantly share code, notes, and snippets.

@andrey-str
Created June 26, 2016 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrey-str/00db62a516b89baf5afe9e8665bd6bd7 to your computer and use it in GitHub Desktop.
Save andrey-str/00db62a516b89baf5afe9e8665bd6bd7 to your computer and use it in GitHub Desktop.
Hide/show CKEditor toolbar on focus events
subscribeToEditorHideEvents = (id) ->
CKEDITOR.instances[id].on 'instanceReady', (e) ->
$('#cke_' + id + " [id$='_top']").hide()
$('#cke_' + id + " [id$='_bottom']").hide()
@on 'focus', ->
$('#cke_' + id + " [id$='_top']").show()
$('#cke_' + id + " [id$='_bottom']").show()
return
@on 'blur', ->
$('#cke_' + id + " [id$='_top']").hide()
$('#cke_' + id + " [id$='_bottom']").hide()
return
return
@andrey-str
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment