$(document).ready(function() { $('.nd_collapse_columns').collapser({ target: 'next', effect: 'slide', changeText: true, expandHtml: '', collapseHtml: '', }); $('.nd_collapse_portprop').collapser({ target: 'next', effect: 'slide', changeText: true, expandHtml: '', collapseHtml: '', }); $('.nd_collapse_nodeprop').collapser({ target: 'next', effect: 'slide', changeText: true, expandHtml: '', collapseHtml: '', }); $('.nd_collapse_legend').collapser({ target: 'next', effect: 'slide', changeText: true, expandHtml: '', collapseHtml: '', }); // parameterised for the active tab - submits search form and injects // HTML response into the tab pane, or an error/empty-results message function do_search (event, tab) { var form = '#' + tab + '_form'; var target = '#' + tab + '_pane'; var mark = '#' + tab + '_bookmark'; // stop form from submitting normally event.preventDefault(); // get the form params var query = $(form).serialize(); // in case of slow data load, let the user know $(target).html( '
' ); // submit the query and put results into the tab pane $(target).load( '/ajax/content/device/' + tab + '?' + query, function(response, status, xhr) { if (status !== "success") { $(target).html( '' ); return; } if (response === "") { $(target).html( '' ); } // looks good, update the bookmark for this search $(mark).attr('href', '/device?' + query); // enable collapser on any large vlan lists $('.nd_collapse_vlans').collapser({ target: 'next', effect: 'slide', changeText: true, expandHtml: '