aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mousetrap/plugins/global-bind/mousetrap-global-bind.js
diff options
context:
space:
mode:
authorTeddy Wing2021-03-21 17:23:11 +0100
committerTeddy Wing2021-03-21 17:47:35 +0100
commita129f8e229f16292d65ffd9dcf9f8a585aa3fe8a (patch)
tree02b50df62163bc86570488ecc587489f5c09e3a2 /lib/mousetrap/plugins/global-bind/mousetrap-global-bind.js
parent5ba6d5d6b508c535efb4ab43b02c6c21bfd49185 (diff)
downloadPeniquitous-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/global-bind/mousetrap-global-bind.js')
-rw-r--r--lib/mousetrap/plugins/global-bind/mousetrap-global-bind.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/mousetrap/plugins/global-bind/mousetrap-global-bind.js b/lib/mousetrap/plugins/global-bind/mousetrap-global-bind.js
deleted file mode 100644
index 1c4ac14..0000000
--- a/lib/mousetrap/plugins/global-bind/mousetrap-global-bind.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * adds a bindGlobal method to Mousetrap that allows you to
- * bind specific keyboard shortcuts that will still work
- * inside a text input field
- *
- * usage:
- * Mousetrap.bindGlobal('ctrl+s', _saveChanges);
- */
-/* global Mousetrap:true */
-(function(Mousetrap) {
- var _globalCallbacks = {};
- var _originalStopCallback = Mousetrap.prototype.stopCallback;
-
- Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
- var self = this;
-
- if (self.paused) {
- return true;
- }
-
- if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
- return false;
- }
-
- return _originalStopCallback.call(self, e, element, combo);
- };
-
- Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
- var self = this;
- self.bind(keys, callback, action);
-
- if (keys instanceof Array) {
- for (var i = 0; i < keys.length; i++) {
- _globalCallbacks[keys[i]] = true;
- }
- return;
- }
-
- _globalCallbacks[keys] = true;
- };
-
- Mousetrap.init();
-}) (Mousetrap);