浏览代码

Add new mailform clenup

Alexey Edelev 5 年之前
父节点
当前提交
c3f5c58657
共有 1 个文件被更改,包括 10 次插入1 次删除
  1. 10 1
      web/js/index.js

+ 10 - 1
web/js/index.js

@@ -394,6 +394,15 @@ function setMailNewVisible(visible) {
         $("#mailNew").hide()
         $("#mailList").css({pointerEvents: "auto"})
     }
+
+    while (toEmailList.length > 0 && $("#toEmailList").children().length > 1) {
+        removeToEmail($("#toEmailList").children()[$("#toEmailList").children().length - 2].id, toEmailList[toEmailList.length - 1])
+    }
+    toEmailList = new Array()
+    $("#newMailEditor").val("")
+    $("#newMailSubject").val("")
+    $("#newMailTo").val("")
+    $("#toEmailField").val("")
 }
 
 function updateMailList(folder, page) {
@@ -511,4 +520,4 @@ window.onbeforeunload = function() {
         notifierSocket.onclose = function () {}; // disable onclose handler first
         notifierSocket.close();
     }
-};
+};