Refactor: use better function

Lan Hui 2022-08-02 12:33:41 +08:00
parent 1d8671c5c7
commit ecc354bc0d
2 changed files with 2 additions and 3 deletions

View File

@ -71,14 +71,13 @@ function fillInWord2() {
cancelHighlighting();
}
function ChangeHighlight() {
function toggleHighlighting() {
if (isHighlight) {
isHighlight = false;
cancelHighlighting();
} else {
isHighlight = true;
highLight();
}
}

View File

@ -38,7 +38,7 @@
<p><b>阅读文章并回答问题</b></p>
<div id="text-content">{{ today_article|safe }}</div>
<input type="checkbox" onclick="ChangeHighlight()" checked/>生词高亮
<input type="checkbox" onclick="toggleHighlighting()" checked/>生词高亮
<input type="checkbox" onclick="onReadClick()" checked/>大声朗读
<input type="checkbox" onclick="onChooseClick()" checked/>划词入库
<div class="range">