Skip to content

Commit

Permalink
Make global-bind plugin safe in node envs
Browse files Browse the repository at this point in the history
When mousetrap loads in a non-dom environment, it bails early and doesn't set the Mousetrap global. Make the global-bind plugin detect that Mousetrap didn't initialize and bail itself.
  • Loading branch information
blowery authored Nov 20, 2019
1 parent 9b8837b commit 42a8b45
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/global-bind/mousetrap-global-bind.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/
/* global Mousetrap:true */
(function(Mousetrap) {
if (! Mousetrap) {
return;
}
var _globalCallbacks = {};
var _originalStopCallback = Mousetrap.prototype.stopCallback;

Expand Down

0 comments on commit 42a8b45

Please sign in to comment.