more js refactoring for report and search

This commit is contained in:
Oliver Gorwits
2013-05-09 21:53:39 +01:00
parent 479ac0e55d
commit 2e8ac83173
2 changed files with 11 additions and 4 deletions

View File

@@ -8,4 +8,8 @@
// on load, check initial Device Search Options form state, // on load, check initial Device Search Options form state,
// and on each change to the form fields // and on each change to the form fields
$(document).ready(function() { }); $(document).ready(function() {
var tab = '[% report.tag %]'
var target = '#' + tab + '_pane';
});

View File

@@ -7,13 +7,16 @@
.add("#device_form .clearfix select"); .add("#device_form .clearfix select");
// this is called by do_search to support local code // this is called by do_search to support local code
// here, when tab changes need to strike/unstrike the navbar search // which might need to act on the newly inserted content
// but which cannot use jQuery delegation via .on()
function inner_view_processing(tab) { function inner_view_processing(tab) {
} }
// on load, check initial Device Search Options form state, // on load, establish global delegations for now and future
// and on each change to the form fields
$(document).ready(function() { $(document).ready(function() {
var tab = '[% tab.tag %]'
var target = '#' + tab + '_pane';
// sidebar form fields should change colour and have bin/copy icon // sidebar form fields should change colour and have bin/copy icon
form_inputs.each(function() {device_form_state($(this))}); form_inputs.each(function() {device_form_state($(this))});
form_inputs.change(function() {device_form_state($(this))}); form_inputs.change(function() {device_form_state($(this))});