"Undo" icon in device port sidebar to reset form to defaults
Squashed commit of the following: commit204f5627e0Author: Oliver Gorwits <oliver@cpan.org> Date: Fri Sep 20 22:33:32 2013 +0100 update undo icon link commit49399301b9Merge:905a192ce604caAuthor: Oliver Gorwits <oliver@cpan.org> Date: Fri Sep 20 21:04:56 2013 +0100 Merge branch 'master' into og-reset-cookie commit905a192426Author: Oliver Gorwits <oliver@cpan.org> Date: Fri Sep 20 21:04:18 2013 +0100 fix tooltip z-index bug, add undo icon commit3377518634Author: Oliver Gorwits <oliver@cpan.org> Date: Fri Sep 13 08:36:16 2013 +0100 reset params used in query
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
var form = '#' + tab + '_form';
|
||||
var query = $(form).serialize();
|
||||
|
||||
if (show == '1') {
|
||||
if (show.length) {
|
||||
$('#nd_csv-download')
|
||||
.attr('href', '/ajax/content/' + type + '/' + tab + '?' + query)
|
||||
.attr('download', 'netdisco-' + type + '-' + tab + '.csv')
|
||||
@@ -81,6 +81,8 @@
|
||||
copy_navbar_to_sidebar('[% tab.tag %]');
|
||||
|
||||
[% 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();
|
||||
@@ -88,6 +90,10 @@
|
||||
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', '/device?tab=ports&reset=on&' +
|
||||
$('#ports_form').find('input[name="q"],input[name="f"],input[name="partial"]').serialize())
|
||||
[% END %]
|
||||
|
||||
do_search(event, '[% tab.tag %]');
|
||||
|
||||
Reference in New Issue
Block a user