From 95cc20aa88fad2c4e94896b7fb4535e5068b3910 Mon Sep 17 00:00:00 2001 From: Daniel Morgenstern Date: Mon, 26 Feb 2018 22:15:18 +0100 Subject: [PATCH 1/2] fixes Make `usedKeyNumbers` configurable #554 --- src/js/pannellum.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index 09f12bf..cad2cfa 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -103,6 +103,7 @@ var defaultConfig = { draggable: true, disableKeyboardCtrl: false, crossOrigin: 'anonymous', + usedKeyNumbers: [16, 17, 27, 37, 38, 39, 40, 61, 65, 68, 83, 87, 107, 109, 173, 187, 189], }; // Translatable / configurable strings @@ -129,8 +130,6 @@ defaultConfig.strings = { unknownError: 'Unknown error. Check developer console.', } -var usedKeyNumbers = [16, 17, 27, 37, 38, 39, 40, 61, 65, 68, 83, 87, 107, 109, 173, 187, 189]; - // Initialize container container = typeof container === 'string' ? document.getElementById(container) : container; container.classList.add('pnlm-container'); @@ -1009,7 +1008,7 @@ function onDocumentKeyPress(event) { var keynumber = event.which || event.keycode; // Override default action for keys that are used - if (usedKeyNumbers.indexOf(keynumber) < 0) + if (config.usedKeyNumbers.indexOf(keynumber) < 0) return event.preventDefault(); @@ -1045,7 +1044,7 @@ function onDocumentKeyUp(event) { var keynumber = event.which || event.keycode; // Override default action for keys that are used - if (usedKeyNumbers.indexOf(keynumber) < 0) + if (config.usedKeyNumbers.indexOf(keynumber) < 0) return event.preventDefault(); From 52a83e8d6ba33664561da9e0f6bc2462c036a2cc Mon Sep 17 00:00:00 2001 From: Daniel Morgenstern Date: Mon, 26 Feb 2018 22:46:43 +0100 Subject: [PATCH 2/2] Ignore IntelliJ Files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 39d3807..0194eed 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ build/** # Ignore generated docs utils/doc/generated_docs + +# Ignore IntelliJ Files +.idea