|
@@ -14,6 +14,22 @@ window.addEventListener('keydown', (e) => {
|
|
Mousetrap.trigger(String.fromCharCode(e.which).toLowerCase());
|
|
Mousetrap.trigger(String.fromCharCode(e.which).toLowerCase());
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+// Store the original stopCallback in a global
|
|
|
|
+const originalStopCallback = Mousetrap.stopCallback;
|
|
|
|
+
|
|
|
|
+// Overwrite the stopCallback to allow for more keyboard shortcut customizations
|
|
|
|
+Mousetrap.stopCallback = (e, element) => {
|
|
|
|
+ // Are shortcuts enabled for the user?
|
|
|
|
+ if (!ReactiveCache.getCurrentUser().isKeyboardShortcuts())
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ // Make sure there are no selected characters
|
|
|
|
+ if (window.getSelection().type === "Range")
|
|
|
|
+ return true;
|
|
|
|
+
|
|
|
|
+ return originalStopCallback(e, element);
|
|
|
|
+}
|
|
|
|
+
|
|
function getHoveredCardId() {
|
|
function getHoveredCardId() {
|
|
const card = $('.js-minicard:hover').get(0);
|
|
const card = $('.js-minicard:hover').get(0);
|
|
if (!card) return null;
|
|
if (!card) return null;
|