From f8f64606ba586cbe1674a935dad1ff8087e49813 Mon Sep 17 00:00:00 2001 From: Pavion Date: Fri, 1 Apr 2016 15:29:52 +0200 Subject: [PATCH] Fix for switches being unswitched Fix for table data being purged --- js/jquery.slickswitch.js | 2 ++ js/tvstreamrecord.basic.js | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/js/jquery.slickswitch.js b/js/jquery.slickswitch.js index 491a4ce..c1747b1 100644 --- a/js/jquery.slickswitch.js +++ b/js/jquery.slickswitch.js @@ -62,6 +62,7 @@ self.bind('ss-toggleOn', function () { self[0].checked = true; + self.attr("checked","checked"); settings.toggledOn(self); settings.toggled(self); self.trigger('ss-update'); @@ -69,6 +70,7 @@ self.bind('ss-toggleOff', function () { self[0].checked = false; + self.removeAttr("checked"); settings.toggledOff(self); settings.toggled(self); self.trigger('ss-update'); diff --git a/js/tvstreamrecord.basic.js b/js/tvstreamrecord.basic.js index f73140f..bb972d9 100644 --- a/js/tvstreamrecord.basic.js +++ b/js/tvstreamrecord.basic.js @@ -672,6 +672,7 @@ $(function() { "bAutoWidth": false, "sAjaxSource": "/getrecordlist", "stateSave": true, + "stateDuration": 60 * 60 * 60 * 24, "stateSaveCallback": function (oSettings, oData) { oData.search.search=''; // Don't save search text localStorage.setItem( 'DataTables_'+where(), JSON.stringify(oData) ); @@ -801,8 +802,7 @@ $(function() { var epggrab = 0; if ($("#switch_list_active").attr("checked") == "checked") {akt = 1;} if ($("#switch_list_grab").attr("checked") == "checked") {epggrab = 1;} - console.log(akt); - console.log(epggrab); + post("/create_channel", { prev: $("#prev").val(), ccid: $("#ccid").val(), @@ -870,6 +870,7 @@ $(function() { "bProcessing": true, "sAjaxSource": "/channellist", "stateSave": true, + "stateDuration": 60 * 60 * 60 * 24, "stateSaveCallback": function (oSettings, oData) { oData.search.search=''; // Don't save search text localStorage.setItem( 'DataTables_'+where(), JSON.stringify(oData) ); @@ -1100,6 +1101,7 @@ $(function() { }, "bServerSide": serverSide, "stateSave": true, + "stateDuration": 60 * 60 * 60 * 24, "stateSaveCallback": function (oSettings, oData) { oData.search.search=''; // Don't save search text localStorage.setItem( 'DataTables_'+where(), JSON.stringify(oData) ); @@ -1259,7 +1261,7 @@ $(function() { } } else if ($(this).attr('id').startsWith('cfg_switch') && $(this).attr('type')!="checkbox") { value = "null"; - } else if ($(this).attr('id').startsWith('cfg_switch')) { + } else if ($(this).attr('id').startsWith('cfg_switch')) { value = ($(this).attr('checked')=="checked") ? "1" : "0"; } else if ( // Reload page on this changes only ($(this).attr('id')=="cfg_theme") || @@ -1358,6 +1360,7 @@ $(function() { "bProcessing": true, "sAjaxSource": "/logget", "stateSave": true, + "stateDuration": 60 * 60 * 60 * 24, "stateSaveCallback": function (oSettings, oData) { oData.search.search=''; // Don't save search text localStorage.setItem( 'DataTables_'+where(), JSON.stringify(oData) );