Просмотр исходного кода

:bug: 句子消息不能显示

visuddhinanda 5 лет назад
Родитель
Сommit
a479574c14
1 измененных файлов с 35 добавлено и 0 удалено
  1. 35 0
      app/studio/js/data.js

+ 35 - 0
app/studio/js/data.js

@@ -637,6 +637,7 @@ function projectDataParse(xmlBookData) {
           .getItem("msg_" + g_docid)
           .then(function (value) {
             gDocMsgList = value;
+            doc_msg_refresh_sent();
             console.log(value.length);
           })
           .catch(function (err) {
@@ -708,3 +709,37 @@ function doc_msg_get_trans(book, para, begin, end) {
   }
   return output;
 }
+
+function doc_msg_refresh_sent() {
+  for (const it of gDocMsgList) {
+    if (it.type == 2) {
+      if (
+        book == it.data.book &&
+        para == it.data.para &&
+        begin == it.data.begin
+      ) {
+        $(
+          "[pcds='sent-net'][book='" +
+            it.data.book +
+            "'][para='" +
+            it.data.para +
+            "'][begin='" +
+            it.data.begin +
+            "']"
+        ).html(obj.data.text);
+
+        $(
+          "[pcds='sent-net-div'][book='" +
+            it.data.book +
+            "'][para='" +
+            it.data.para +
+            "'][begin='" +
+            it.data.begin +
+            "']"
+        )
+          .find(".author")
+          .html(it.sender);
+      }
+    }
+  }
+}