Refactor: use better function

Bug412-JiangLetian-Refactor
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(); cancelHighlighting();
} }
function ChangeHighlight() { function toggleHighlighting() {
if (isHighlight) { if (isHighlight) {
isHighlight = false; isHighlight = false;
cancelHighlighting(); cancelHighlighting();
} else { } else {
isHighlight = true; isHighlight = true;
highLight(); highLight();
} }
} }

View File

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