Changeset 29320


Ignore:
Timestamp:
2014-09-22T13:20:54+12:00 (10 years ago)
Author:
kjdon
Message:

Using .attr to access 'checked' doesn't work in jquery 1.9.2 and higher. Changing to use .prop instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/document_scripts.js

    r29226 r29320  
    966966{
    967967    var hlCheckbox = $("#highlightOption");
    968 
    969968    if(imageClicked)
    970969    {
    971         $(hlCheckbox).attr("checked", !$(hlCheckbox).attr("checked"));
    972     }
    973    
     970      // toggle the state of the checkbox
     971      $(hlCheckbox).prop("checked", !$(hlCheckbox).prop("checked"));
     972    }
    974973    var from;
    975974    var to;
    976     if(hlCheckbox.attr("checked"))
     975    if(hlCheckbox.prop("checked"))
    977976    {
    978977        from = "noTermHighlight";
     
    10361035        option.attr("onclick", "hideText(); showBook(); swapLinkJavascript(false);");
    10371036        optionImage.attr("onclick", "hideText(); showBook(); swapLinkJavascript(false);");
    1038         $(option).attr("checked", false);
     1037        $(option).prop("checked", false);
    10391038    }
    10401039    else
     
    10421041        option.attr("onclick", "hideBook(); showText(); swapLinkJavascript(true);");
    10431042        optionImage.attr("onclick", "hideBook(); showText(); swapLinkJavascript(true);");
    1044         $(option).attr("checked", true);
     1043        $(option).prop("checked", true);
    10451044    }
    10461045}
     
    14161415       
    14171416        $("#unfloatTOCButton").hide();
    1418         $("#floatTOCToggle").attr("checked", false);
     1417        $("#floatTOCToggle").prop("checked", false);
    14191418    }
    14201419   
Note: See TracChangeset for help on using the changeset viewer.