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

Allows for the unregistering of custom key commands. #534

Merged
merged 1 commit into from
Feb 21, 2017

Conversation

disordinary
Copy link
Collaborator

@disordinary disordinary commented Feb 20, 2017

  • Allows users to add an optional name attribute to a keyCommand object as passed to the registerKeyCommand method.

  • If the name attribute is added a new unregisterKeyCommands method will remove these key commands from the key command array.
    Multiple key commands can have the same name, if so unregisterKeyCommands will remove all instances with that name.

Usage:

  editor.registerKeyCommand({
    name: 'cut',
    str: 'ctrl+x',
    run(editor) { ... }
  });

  editor.unregisterKeyCommands('cut');

…ct as passed to the `registerKeyCommand` method.

If the `name` attribute is added a new `unregisterKeyCommands` method will remove these keycommands from the keycommand array.
Multiple keycommands can have the same name, if so unregisterKeyCommands will remove all instances with that name.

Usage:

```
  editor.registerKeyCommand({
    name: 'cut',
    str: 'ctrl+x',
    run(editor) { ... }
  });

  editor.unregisterKeyCommands('cut');
```
@bantic
Copy link
Collaborator

bantic commented Feb 21, 2017

+1 thanks @disordinary, looks good to me :)

@bantic bantic merged commit 0cc12d3 into bustle:master Feb 21, 2017
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