1
0
قرینه از https://github.com/matomo-org/matomo.git synced 2025-08-22 23:17:46 +00:00
Files
matomo/node_modules/mousetrap/plugins/pause/mousetrap-pause.js
diosmosis b12946909f run npm update and include node_modules (#16079)
* update npm packages to latest

* fix javascript path location

* update screenshots

* Add node_modules for users that do not have npm insalled but use git to deploy.

* fix release checklist test

* Add old chroma-js + some files missing from node_module.

* remove npm install

* fix .travis.yml

* update expected screenshots

* update submodule

Co-authored-by: sgiehl <stefan@matomo.org>
2020-06-26 02:33:41 -07:00

32 خطوط
779 B
JavaScript
Vendored

/**
* 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);