Fix rendering of offline schedule
authorDaniel Gustafsson <daniel@yesql.se>
Fri, 7 Sep 2018 10:01:51 +0000 (12:01 +0200)
committerDaniel Gustafsson <daniel@yesql.se>
Fri, 7 Sep 2018 10:01:51 +0000 (12:01 +0200)
The offline code was using the deprecated .live function which was
removed in jQuery 1.9. This is a follow-up commit to 53ce8f3304eac
which fixed the same bug for sessionvoting.

template/confreg/mobile/index.html

index 1aae5f4d58c68ee2159da7308f7b91968956feef..c46e8d649bc31f29e83529bb12fcf78cacd2bc5e 100644 (file)
@@ -288,7 +288,7 @@ function saveSetting(name, val) {
 /*
  * Initialize events
  */
-$('#index').live('pageinit', function(event) {
+$(document).on('pageinit', '#index', function(event){
    if (!supports_html5_storage()) {
       alert('Sorry, this app only works if your browser supports local storage!');
       return;
@@ -317,15 +317,15 @@ $('#index').live('pageinit', function(event) {
 });
 
 // Settings form
-$('#set_autosync').live('change', function(e) {
+$(document).on('change', '#set_autosync', function(e) {
    saveSetting('autosync', $('#set_autosync').val());
 });
 
-$('#schedule').live('pageinit',function(event){
+$(document).on('pageinit', '#schedule', function(event){
    update_schedule();
 });
 
-$('#news').live('pageinit', function(event) {
+$(document).on('pageinit', '#news', function(even) {
    if (localStorage['{{conf.urlname}}_news_unread']) {
       localStorage['{{conf.urlname}}_news_unread'] = 0;
       $('#newsunreadcount').text('0');