RSS Git Download  Clone
Raw Blame History
<!-- BEGIN [% component.name %] %] -->
    [%
        section_ids = []; # for showhide_screens() function
        FOREACH entry IN lab_sections;
            NEXT UNLESS entry.is_active.match('yes');
            section_ids.push(entry.id);
        END; # INCLUDE dumper.tt dump = section_ids;
    %]
    
	<script language="javascript" type="text/javascript">
		function showhide_results_summaries(f,v) {
			var t = f.results_summary_id;
            var sectionIds = [ [% section_ids.join(',') %] ];

			// does value of 'v' match any of categoryIds array:
			match = jQuery.grep(sectionIds, function (a) { return a == v; }); // alert(match);

			if (match.length) { // ie contains the value of category_id
				t.style.visibility='visible';
			}
			else {
				t.style.visibility='hidden';
			}			
		}

		// use addLoadEvent function in common.js for onload:
		[% UNLESS results_summary %]
		  addLoadEvent(
			function() { 
				document.results_summary.results_summary_id.style.visibility='hidden';
			}
		  );
		[% END %]

		// lab-section onChange event for result_summary_id select menu
		$(document).ready(function () {
			$('#lab_section').change( function() {
				$('#summary_description').load('[% c.query.url(path_info=1)
					%]/results_summaries', {
						section_id: $('#lab_section').val()	
				})
			})
		});		
	</script>
<!-- END [% component.name %] %] -->