Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instanceReadyCallback prop to allow attaching a custom instanceReady callback #68

Merged

Conversation

fernandomm
Copy link
Contributor

This allows user to set a function that will be attached to CKEditor's instanceReady event.

It's useful because some events like fileUploadRequest can only be attached to the editor instance.

Here is an example:

<template>
  <div>
    <vue-ckeditor :instanceReadyCallback="ckEditorReadyCallback"></vue-ckeditor>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ckEditorReadyCallback: function(readyEvent) {
        readyEvent.editor.on('fileUploadRequest', function(evt) {
          var xhr = evt.data.fileLoader.xhr

          xhr.setRequestHeader('My-Custom-Header', 'Example')
        }
      }
    }
  }
}
</script>

@dangvanthanh dangvanthanh merged commit 9765465 into dangvanthanh:master Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants