Modify judgment logic

The element id in the page either exists or does not exist, and the 
checkbox box has only two states.Unless there is a third case, 
we use else if

Change-Id: I0eb059757104b1ddd9a8758ce8833c51c52a58b6
changes/47/620247/3
gaobin 4 years ago
parent 212d08ae6e
commit 705efb493c
  1. 2
      _custom/admonition_selector.js

@ -21,7 +21,7 @@ $(document).ready(function() {
// check value of cookies and set state to the related element
if ($.cookie($(this).attr("id")) == "true") {
$(this).prop("checked", true);
} else if (($.cookie($(this).attr("id")) == "false")) {
} else {
$(this).prop("checked", false);
}

Loading…
Cancel
Save