From 4921332f77f9ba40df9101a55880930a66341b0c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 24 Aug 2019 19:46:50 +0100 Subject: [PATCH] Minimize javascript use --- webinterface.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/webinterface.py b/webinterface.py index 41a409e71..24b0f5234 100644 --- a/webinterface.py +++ b/webinterface.py @@ -992,24 +992,8 @@ def clickToDropDownScript() -> str: """Function run onclick to create a dropdown """ script= \ - '/* When the user clicks on the button,' \ - 'toggle between hiding and showing the dropdown content */' \ 'function dropdown() {' \ ' document.getElementById("myDropdown").classList.toggle("show");' \ - '}' \ - '' \ - '// Close the dropdown menu if the user clicks outside of it' \ - 'window.onclick = function(event) {' \ - " if (!event.target.matches('.dropdown')) {" \ - ' var dropdowns = document.getElementsByClassName("dropdown-content");' \ - ' var i;' \ - ' for (i = 0; i < dropdowns.length; i++) {' \ - ' var openDropdown = dropdowns[i];' \ - " if (openDropdown.classList.contains('show')) {" \ - " openDropdown.classList.remove('show');" \ - ' }' \ - ' }' \ - ' }' \ '}' return script