diff --git a/Netdisco/share/public/javascripts/netdisco.js b/Netdisco/share/public/javascripts/netdisco.js index 6cc9da3a..865eb60e 100644 --- a/Netdisco/share/public/javascripts/netdisco.js +++ b/Netdisco/share/public/javascripts/netdisco.js @@ -169,8 +169,6 @@ $(document).ready(function() { // sidebar form fields should change colour and have bin/copy icon $('.field_copy_icon').hide(); $('.field_clear_icon').hide(); - form_inputs.each(function() {device_form_state($(this))}); - form_inputs.change(function() {device_form_state($(this))}); // activate typeahead on the main search box, for device names only $('#nq').typeahead({ diff --git a/Netdisco/share/views/js/device.js b/Netdisco/share/views/js/device.js index bfcf9ee1..fe1dd136 100644 --- a/Netdisco/share/views/js/device.js +++ b/Netdisco/share/views/js/device.js @@ -99,6 +99,10 @@ } $(document).ready(function() { + // sidebar form fields should change colour and have bin/copy icon + form_inputs.each(function() {device_form_state($(this))}); + form_inputs.change(function() {device_form_state($(this))}); + // sidebar collapser events trigger change of up/down arrow $('.collapse').on('show', function() { $(this).siblings().find('.arrow-up-down') diff --git a/Netdisco/share/views/js/search.js b/Netdisco/share/views/js/search.js index 927d6b01..32193ce4 100644 --- a/Netdisco/share/views/js/search.js +++ b/Netdisco/share/views/js/search.js @@ -14,6 +14,10 @@ // on load, check initial Device Search Options form state, // and on each change to the form fields $(document).ready(function() { + // sidebar form fields should change colour and have bin/copy icon + form_inputs.each(function() {device_form_state($(this))}); + form_inputs.change(function() {device_form_state($(this))}); + // handler for copy icon in search option $('.field_copy_icon').click(function() { var name = $(this).data('btn-for');