aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mousetrap/plugins/pause/mousetrap-pause.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mousetrap/plugins/pause/mousetrap-pause.js')
-rw-r--r--lib/mousetrap/plugins/pause/mousetrap-pause.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/mousetrap/plugins/pause/mousetrap-pause.js b/lib/mousetrap/plugins/pause/mousetrap-pause.js
deleted file mode 100644
index 0138b8a..0000000
--- a/lib/mousetrap/plugins/pause/mousetrap-pause.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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);