refactor device ports sidebar params handling

This commit is contained in:
Oliver Gorwits
2017-12-10 11:47:51 +00:00
parent 9e91431411
commit f8cee4cff6
6 changed files with 98 additions and 161 deletions

View File

@@ -94,13 +94,13 @@
[% 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 });
// 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=[% tab.tag %]&reset=on&' +