diff --git a/js/frs.js b/js/frs.js new file mode 100644 index 0000000..23c0b98 --- /dev/null +++ b/js/frs.js @@ -0,0 +1,18 @@ +document.addEventListener("DOMContentLoaded", function(event) { + var all_selects = document.getElementsByTagName('select'); + for (var i in all_selects) { + if (!all_selects.hasOwnProperty(i)) { + continue; + } + var xsel = all_selects[i]; + var xvalue = xsel.dataset.value; + //console.log('Value of %o = %o', xsel, xvalue); + // Walk all options, compare to desired value and set if matches + for (var o in xsel.options) { + if (xsel.options[o].value == xvalue) { + xsel.selectedIndex = o; + break; + } + } + } +}); diff --git a/templates/hotel_html.mustache b/templates/hotel_html.mustache index 0a0a39d..84c1f49 100644 --- a/templates/hotel_html.mustache +++ b/templates/hotel_html.mustache @@ -29,7 +29,7 @@ - + {{> mdl_content_foot}} {{> mdl_foot}} {{> html_foot}} diff --git a/templates/partials/mdl_input_country.mustache b/templates/partials/mdl_input_country.mustache index 89f88af..503edf6 100644 --- a/templates/partials/mdl_input_country.mustache +++ b/templates/partials/mdl_input_country.mustache @@ -1,6 +1,6 @@