mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2025-01-10 18:50:03 +01:00
7a116201f7
The script that automatically adds the copyright notice was wrongly configured.
30 lines
678 B
JavaScript
30 lines
678 B
JavaScript
/**
|
|
* 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 */
|
|
Mousetrap = (function(Mousetrap) {
|
|
var self = Mousetrap,
|
|
_originalStopCallback = self.stopCallback,
|
|
enabled = true;
|
|
|
|
self.stopCallback = function(e, element, combo) {
|
|
if (!enabled) {
|
|
return true;
|
|
}
|
|
|
|
return _originalStopCallback(e, element, combo);
|
|
};
|
|
|
|
self.pause = function() {
|
|
enabled = false;
|
|
};
|
|
|
|
self.unpause = function() {
|
|
enabled = true;
|
|
};
|
|
|
|
return self;
|
|
}) (Mousetrap);
|