Skip to content

Commit

Permalink
Fix bug in hotkeys plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Jan 31, 2018
1 parent b3563ea commit d6683cf
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 771 deletions.
8 changes: 5 additions & 3 deletions src/Jodit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,11 @@ export class Jodit extends Component {
const hotkeys: string | string[] | void = this.options.commandToHotkeys[commandName] || this.options.commandToHotkeys[commandNameOriginal] || command.hotkeys;

if (hotkeys) {
this.events.on(asArray(hotkeys).map((hotkey: string) => hotkey + '.hotkey').join(' '), () => {
return this.execCommand(commandName); // because need `beforeCommand`
});
this.events
.off(asArray(hotkeys).map((hotkey: string) => hotkey + '.hotkey').join(' '))
.on(asArray(hotkeys).map((hotkey: string) => hotkey + '.hotkey').join(' '), () => {
return this.execCommand(commandName); // because need `beforeCommand`
});
}
}
}
Expand Down
Loading

0 comments on commit d6683cf

Please sign in to comment.