Browse Source

:bug: 显示注释div错误

visuddhinanda 5 years ago
parent
commit
bc16896ae7
1 changed files with 6 additions and 6 deletions
  1. 6 6
      app/studio/js/render.js

+ 6 - 6
app/studio/js/render.js

@@ -3077,17 +3077,17 @@ function refreshWordNoteDiv(elementBlock) {
 	let html = renderWordNoteDivByElement(elementBlock);
 	let xmlParInfo = elementBlock.getElementsByTagName("info")[0];
 	let book = getNodeText(xmlParInfo, "book");
-	let paragraph = getNodeText(xmlParInfo, "paragraph");
+	let paragraph = parseInt(getNodeText(xmlParInfo, "paragraph"));
+	let noteid = "wnote_" + book + "_" + (paragraph - 1);
 	try {
 		if (html == "") {
-			document.getElementById("wnote_" + book + "_" + (paragraph - 1)).style.display = "none";
+			$("#" + noteid).hide();
 		} else {
-			document.getElementById("wnote_" + book + "_" + (paragraph - 1)).style.display = "block";
+			$("#" + noteid).html(html);
+			$("#" + noteid).show();
 		}
-		document.getElementById("wnote_" + book + "_" + (paragraph - 1)).innerHTML = html;
 	} catch (e) {
-		console.error(e.message);
-		console.error("wnote_" + book + "_" + (paragraph - 1));
+		console.error(e.message + noteid);
 	}
 }