Fix DataTable state storage

This commit is contained in:
kaso17
2017-01-31 17:24:42 +01:00
parent 8e7aa1b29c
commit 2086811596
2 changed files with 5 additions and 11 deletions

View File

@@ -821,13 +821,7 @@ function bindUIButtons() {
var table = releaseDialog.find('table'); var table = releaseDialog.find('table');
table.DataTable( table.DataTable(
{ {
stateSave: true, "stateSave": true,
stateSaveCallback: function (settings, data) {
localStorage.setItem( 'DataTables_' + settings.sInstance, JSON.stringify(data) )
},
stateLoadCallback: function (settings) {
return JSON.parse( localStorage.getItem( 'DataTables_' + settings.sInstance ) )
},
"pageLength": 20, "pageLength": 20,
"lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "All"]], "lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "All"]],
"order": [[0, "desc"]], "order": [[0, "desc"]],

View File

@@ -190,7 +190,7 @@
<script id="configured-indexer-table" type="text/x-handlebars-template"> <script id="configured-indexer-table" type="text/x-handlebars-template">
<div class="configured-indexer-div"> <div class="configured-indexer-div">
<table class="indexer-table dataTable compact cell-border hover stripe table table-responsive"> <table id="configured-indexer-datatable" class="indexer-table dataTable compact cell-border hover stripe table table-responsive">
<thead> <thead>
<tr> <tr>
<th>Indexer</th> <th>Indexer</th>
@@ -235,7 +235,7 @@
<script id="unconfigured-indexer-table" type="text/x-handlebars-template"> <script id="unconfigured-indexer-table" type="text/x-handlebars-template">
<div class="unconfigured-indexer-div"> <div class="unconfigured-indexer-div">
<table class="indexer-table dataTable compact cell-border hover stripe table table-responsive"> <table id="unconfigured-indexer-datatable" class="indexer-table dataTable compact cell-border hover stripe table table-responsive">
<thead> <thead>
<tr> <tr>
<th>Indexer</th> <th>Indexer</th>
@@ -283,7 +283,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p>This screen shows releases which have been recently returned from Jackett. Only the last 300 releases for each tracker are returned.</p> <p>This screen shows releases which have been recently returned from Jackett. Only the last 300 releases for each tracker are returned.</p>
<table class="dataTable compact cell-border hover stripe"> <table id="jackett-releases-datatable" class="dataTable compact cell-border hover stripe">
<thead> <thead>
<tr> <tr>
<th>Published</th> <th>Published</th>
@@ -398,7 +398,7 @@
<script id="jackett-search-results" type="text/x-handlebars-template"> <script id="jackett-search-results" type="text/x-handlebars-template">
<hr /> <hr />
<p>Your search was done using: {{#each Indexers}}{{this}}, {{/each}}</p> <p>Your search was done using: {{#each Indexers}}{{this}}, {{/each}}</p>
<table class="dataTable compact cell-border hover stripe"> <table id="jackett-search-results-datatable" class="dataTable compact cell-border hover stripe">
<thead> <thead>
<tr> <tr>
<th>Published</th> <th>Published</th>