From d78c23e00d3007c3fee8c3603acac00efc1ce14e Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 24 Feb 2018 18:18:33 +0100 Subject: Webpack / Remove frontend dependencies from tpl/ & inc/ and move them to assets/ --- assets/vintage/js/base.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 assets/vintage/js/base.js (limited to 'assets/vintage/js') diff --git a/assets/vintage/js/base.js b/assets/vintage/js/base.js new file mode 100644 index 00000000..9bcc96fb --- /dev/null +++ b/assets/vintage/js/base.js @@ -0,0 +1,32 @@ +window.onload = function () { + var continent = document.getElementById('continent'); + var city = document.getElementById('city'); + if (continent != null && city != null) { + continent.addEventListener('change', function(event) { + hideTimezoneCities(city, continent.options[continent.selectedIndex].value, true); + }); + hideTimezoneCities(city, continent.options[continent.selectedIndex].value, false); + } +}; + +/** + * Add the class 'hidden' to city options not attached to the current selected continent. + * + * @param cities List of