From 6d6d876aa5240b5117398ab44b0fb3b3fdabc219 Mon Sep 17 00:00:00 2001 From: Daniel Scalzi Date: Thu, 18 Jan 2018 23:37:59 -0500 Subject: [PATCH] Changed devtools keybind from 'wcdev' in sequence to 'ctrl + shift + i'. --- app/assets/js/uicore.js | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/app/assets/js/uicore.js b/app/assets/js/uicore.js index ed2cb24..4d67b93 100644 --- a/app/assets/js/uicore.js +++ b/app/assets/js/uicore.js @@ -63,36 +63,13 @@ $(document).on('click', 'a[href^="http"]', function(event) { }) /** - * Opens DevTools window if you type "wcdev" in sequence. + * Opens DevTools window if you hold (ctrl + shift + i). * This will crash the program if you are using multiple * DevTools, for example the chrome debugger in VS Code. */ -const match = [87, 67, 68, 69, 86] -let at = 0; - document.addEventListener('keydown', function (e) { - switch(e.keyCode){ - case match[0]: - if(at === 0) ++at - break - case match[1]: - if(at === 1) ++at - break - case match[2]: - if(at === 2) ++at - break - case match[3]: - if(at === 3) ++at - break - case match[4]: - if(at === 4) ++at - break - default: - at = 0 - } - if(at === 5) { - var window = remote.getCurrentWindow() + if(e.keyCode == 73 && e.ctrlKey && e.shiftKey){ + let window = remote.getCurrentWindow() window.toggleDevTools() - at = 0 } }) \ No newline at end of file