sidebar defaults follow params; fix state saving

This commit is contained in:
Oliver Gorwits
2014-10-25 21:20:28 +01:00
parent bd3bcb36f8
commit 2e29f0b11d
3 changed files with 30 additions and 27 deletions

View File

@@ -148,16 +148,6 @@
update_csv_download_link('device', '[% tab.tag %]', '[% tab.provides_csv %]');
[% IF tab.tag == 'ports' %]
// to be fair I can't remember why we do this in JS and not from the app
// perhaps because selecting form fields to go in the cookie is easier?
var cookie = $('#ports_form').find('input,select')
.not('#nd_port-query,input[name="q"],input[name="tab"]')
.serializeArray();
$('#ports_form').find('input[type="checkbox"]').map(function() {
cookie.push({'name': 'columns', 'value': $(this).attr('name')});
});
$.cookie('nd_ports-form', $.param(cookie) ,{ expires: 365 });
// form reset icon on ports tab
$('#nd_sidebar-reset-link').attr('href', uri_base + '/device/[% tab.tag %]?reset=on&' +
$('#ports_form')