Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/hotkeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
if (typeof callback === 'function') {

// save the original callback
_callback = callback;
_callback = wrapApply(callback);

// make sure allowIn is an array
if (!(allowIn instanceof Array)) {
Expand Down Expand Up @@ -363,15 +363,17 @@
}

if (shouldExecute) {
wrapApply(_callback.apply(this, arguments));
_callback.apply(this, arguments);
}
};
} else {
callback = wrapApply(callback);
}

if (typeof(action) === 'string') {
Mousetrap.bind(combo, wrapApply(callback), action);
Mousetrap.bind(combo, callback, action);
} else {
Mousetrap.bind(combo, wrapApply(callback));
Mousetrap.bind(combo, callback);
}

var hotkey = new Hotkey(combo, description, callback, action, allowIn, persistent);
Expand Down