Santa Fe Institute Collaboration Platform

Thermodynamics of Computation

Difference between revisions of "MediaWiki:Common.js"

From Thermodynamics of Computation
Line 7: Line 7:
 
function runQueryOnABCChange(){
 
function runQueryOnABCChange(){
 
   $('input[name="Reference Material Query ABC[index]"], input[name="Reference Material Query[index]"]').each(function(){
 
   $('input[name="Reference Material Query ABC[index]"], input[name="Reference Material Query[index]"]').each(function(){
         if($(this).prop('checked', true){
+
         if($(this).prop("checked", true){
 
             $(this).parent().css('color', '#36c').css('font-weight', 'bold');  
 
             $(this).parent().css('color', '#36c').css('font-weight', 'bold');  
 
         });
 
         });

Revision as of 12:27, November 30, 2018

/* Any JavaScript here will be loaded for all users on every page load. */

$(document).ready(function() {
    runQueryOnABCChange()
});

function runQueryOnABCChange(){
  $('input[name="Reference Material Query ABC[index]"], input[name="Reference Material Query[index]"]').each(function(){
        if($(this).prop("checked", true){
            $(this).parent().css('color', '#36c').css('font-weight', 'bold'); 
        });
        $(this).on('change', function() {
        var $form = $(this).closest('form');
        $form.find('input[type=submit]').click();
     });
  });
}