diff options
author | Christian Pointner <equinox@helsinki.at> | 2014-09-20 03:52:34 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2014-09-20 03:52:34 (GMT) |
commit | 5991153a593bb2244fc69b314f27d45588eb8848 (patch) | |
tree | ea8cca5c8d286acf97372d89361b258548953fad | |
parent | 680cef1efc6eeb41d0edfddf2d04ea480a1b553d (diff) |
persistent show selection
-rw-r--r-- | index.html | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -53,6 +53,7 @@ + var shows_currentid; var shows_list = []; var current_show; var group_carts = []; @@ -102,8 +103,9 @@ } function showSelectedShow() { - var id = $('#show-selector option:selected').attr('value'); - current_show = $.grep(shows_list, function(elem) { return elem.id == id; })[0]; + shows_currentid = $('#show-selector option:selected').attr('value'); + sessionStorage.setItem("shows_currentid", shows_currentid); + current_show = $.grep(shows_list, function(elem) { return elem.id == shows_currentid; })[0]; $('#show-title').text(current_show.title); $('#show-dow').text(weekday[current_show.dow]); $('#show-rhythm').text(current_show.rhythm); @@ -160,15 +162,21 @@ } } ); + $('#show-selector').val(shows_currentid); showSelectedShow(); } - function app_shows_init() { + function shows_init() { + shows_currentid = sessionStorage.getItem("shows_currentid"); shows_list = []; data = { LOGIN_NAME: username, PASSWORD: token }; $.post("/listdropboxes.cgi", data, updateShowsList, "xml") } + function shows_cleanup() { + sessionStorage.removeItem("shows_currentid"); + delete shows_currentid; + } @@ -186,7 +194,7 @@ $('#app-musicpools').hide(); $('#nav-btn-musicpools').removeClass('active'); app = 'shows'; - app_shows_init(); + shows_init(); } sessionStorage.setItem("app", app); } @@ -249,6 +257,8 @@ delete token; sessionStorage.removeItem("app"); delete app; + + shows_cleanup(); $(".alert").alert('close'); $("#username").val(''); |