frontend/.pnpm-store/v3/files/ac/0eb9db835ac93044a31bdb298d77f4f05c96fe6e42c1e9b80916c5ce28d6f42c855f8596fb81a6965eb552375da8bd91ce71af8883eb772549dbab3e47eba7

32 lines
779 B
Plaintext

/**
* adds a pause and unpause method to Mousetrap
* this allows you to enable or disable keyboard shortcuts
* without having to reset Mousetrap and rebind everything
*/
/* global Mousetrap:true */
(function(Mousetrap) {
var _originalStopCallback = Mousetrap.prototype.stopCallback;
Mousetrap.prototype.stopCallback = function(e, element, combo) {
var self = this;
if (self.paused) {
return true;
}
return _originalStopCallback.call(self, e, element, combo);
};
Mousetrap.prototype.pause = function() {
var self = this;
self.paused = true;
};
Mousetrap.prototype.unpause = function() {
var self = this;
self.paused = false;
};
Mousetrap.init();
}) (Mousetrap);