Files
netdisco/Netdisco/share/views/js/common.js
2013-05-09 21:50:29 +01:00

27 lines
865 B
JavaScript

$(document).ready(function() {
// search tabs
[% FOREACH tab IN settings.search_tabs %]
$('[% "#${tab.tag}_form" %]').submit(function(event){ do_search(event, '[% tab.tag %]'); });
[% END %]
// device tabs
[% FOREACH tab IN settings.device_tabs %]
$('[% "#${tab.tag}_form" %]').submit(function(event){ do_search(event, '[% tab.tag %]'); });
[% END %]
[% IF report %]
// for the report pages
$('[% "#${report.tag}_form" %]').submit(function(event){ do_search(event, '[% report.tag %]'); });
[% END -%]
[% IF task %]
// for the admin pages
$('[% "#${task.tag}_form" %]').submit(function(event){ do_search(event, '[% task.tag %]'); });
[% END %]
// on page load, load the content for the active tab
[% IF params.tab %]
$('#[% params.tab %]_form').trigger("submit");
[% END %]
});