refactor javascript to static file to reduce templating

This commit is contained in:
Oliver Gorwits
2012-01-28 20:44:31 +00:00
parent 5bd481a36a
commit 192f366496
8 changed files with 198 additions and 192 deletions

View File

@@ -0,0 +1,11 @@
$(document).ready(function() {
// search hook for each tab
[% FOREACH tab IN vars.tabs %]
$('[% "#${tab.id}_form" %]').submit(function(event){ do_search(event, '[% tab.id %]'); });
[% END %]
// on page load, load the content for the active tab
[% IF params.tab %]
$('#[% params.tab %]_form').trigger("submit");
[% END %]
});