diff options
author | Teddy Wing | 2021-03-21 17:23:11 +0100 |
---|---|---|
committer | Teddy Wing | 2021-03-21 17:47:35 +0100 |
commit | a129f8e229f16292d65ffd9dcf9f8a585aa3fe8a (patch) | |
tree | 02b50df62163bc86570488ecc587489f5c09e3a2 /lib/mousetrap/plugins/pause | |
parent | 5ba6d5d6b508c535efb4ab43b02c6c21bfd49185 (diff) | |
download | Peniquitous-a129f8e229f16292d65ffd9dcf9f8a585aa3fe8a.tar.bz2 |
Remove Bower-included Mousetrap
Now that we've added Mousetrap via NPM, we can remove the one we
installed via Bower and Bower files.
Didn't really need to switch to NPM, but I wanted to get a Mousetrap
dependency that included its LICENSE file so I could include it in my
build.
Diffstat (limited to 'lib/mousetrap/plugins/pause')
-rw-r--r-- | lib/mousetrap/plugins/pause/README.md | 13 | ||||
-rw-r--r-- | lib/mousetrap/plugins/pause/mousetrap-pause.js | 31 | ||||
-rw-r--r-- | lib/mousetrap/plugins/pause/mousetrap-pause.min.js | 1 |
3 files changed, 0 insertions, 45 deletions
diff --git a/lib/mousetrap/plugins/pause/README.md b/lib/mousetrap/plugins/pause/README.md deleted file mode 100644 index 0b3b3bd..0000000 --- a/lib/mousetrap/plugins/pause/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Pause/unpause - -This extension allows Mousetrap to be paused and unpaused without having to reset keyboard shortcuts and rebind them. - -Usage looks like: - -```javascript -// stop Mousetrap events from firing -Mousetrap.pause(); - -// allow Mousetrap events to fire again -Mousetrap.unpause(); -``` 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); diff --git a/lib/mousetrap/plugins/pause/mousetrap-pause.min.js b/lib/mousetrap/plugins/pause/mousetrap-pause.min.js deleted file mode 100644 index d3df296..0000000 --- a/lib/mousetrap/plugins/pause/mousetrap-pause.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(a){var b=a.prototype.stopCallback;a.prototype.stopCallback=function(a,c,d){return this.paused?!0:b.call(this,a,c,d)};a.prototype.pause=function(){this.paused=!0};a.prototype.unpause=function(){this.paused=!1};a.init()})(Mousetrap); |