Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function addKeyboardShortcut(key, fn) {
Mousetrap.unbind(key);
Mousetrap.bind(key, function(e) {
if (e.preventDefault) {
e.preventDefault();
} else {
// internet explorer
e.returnValue = false;
}
fn();
return false;
});
}
dispose() {
this.drag.dispose()
Mousetrap.unbind('up', 'shift+up', 'down', 'shift+down', 'shift', 'option')
}
componentWillUnmount() {
const { disableTooltip, hotkey, tooltipHotkey } = this.props;
if (!disableTooltip) {
removeToolTipHelp(tooltipHotkey, this.setShowTooltip);
}
unbind(hotkey);
}
componentWillUnmount() {
Mousetrap.unbind('space', this.hide);
Mousetrap.unbind('left', this.backward);
Mousetrap.unbind('right', this.forward);
}
forward() {
componentWillUnmount() {
Mousetrap.unbind('space', this.hide);
Mousetrap.unbind('left', this.backward);
Mousetrap.unbind('right', this.forward);
}
forward() {