aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/vintage/js/shaarli.js
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-07-27 12:34:30 +0200
committerArthurHoaro <arthur@hoa.ro>2019-07-27 12:34:30 +0200
commit38672ba0d1c722e5d6d33a58255ceb55e9410e46 (patch)
treedae4c7c47532380eac3ae641db99122fc77c93dc /tpl/vintage/js/shaarli.js
parent83faedadff76c5bdca036f39f13943f63b27e164 (diff)
parent1e77e0448bbd25675d8c0fe4a73206ad9048904b (diff)
downloadShaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.gz
Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.tar.zst
Shaarli-38672ba0d1c722e5d6d33a58255ceb55e9410e46.zip
Merge tag 'v0.10.4' into stable
Release v0.10.4
Diffstat (limited to 'tpl/vintage/js/shaarli.js')
-rw-r--r--tpl/vintage/js/shaarli.js32
1 files changed, 0 insertions, 32 deletions
diff --git a/tpl/vintage/js/shaarli.js b/tpl/vintage/js/shaarli.js
deleted file mode 100644
index 9bcc96fb..00000000
--- a/tpl/vintage/js/shaarli.js
+++ /dev/null
@@ -1,32 +0,0 @@
1window.onload = function () {
2 var continent = document.getElementById('continent');
3 var city = document.getElementById('city');
4 if (continent != null && city != null) {
5 continent.addEventListener('change', function(event) {
6 hideTimezoneCities(city, continent.options[continent.selectedIndex].value, true);
7 });
8 hideTimezoneCities(city, continent.options[continent.selectedIndex].value, false);
9 }
10};
11
12/**
13 * Add the class 'hidden' to city options not attached to the current selected continent.
14 *
15 * @param cities List of <option> elements
16 * @param currentContinent Current selected continent
17 * @param reset Set to true to reset the selected value
18 */
19function hideTimezoneCities(cities, currentContinent, reset = false) {
20 var first = true;
21 [].forEach.call(cities, function(option) {
22 if (option.getAttribute('data-continent') != currentContinent) {
23 option.className = 'hidden';
24 } else {
25 option.className = '';
26 if (reset === true && first === true) {
27 option.setAttribute('selected', 'selected');
28 first = false;
29 }
30 }
31 });
32}