Browse Source

增加译文channel列表不显示停用channel

visuddhinanda 5 years ago
parent
commit
9728b477b3
1 changed files with 20 additions and 18 deletions
  1. 20 18
      app/term/note.js

+ 20 - 18
app/term/note.js

@@ -947,25 +947,27 @@ function render_one_sent_tran(book, para, begin, end, iterator) {
 function add_new_tran_button_click(obj) {
 	let html = "<ul>";
 	for (const iterator of _my_channal) {
-		if (_channal.indexOf(iterator.id) < 0) {
-			html += '<li onclick="';
-			html +=
-				"new_sentence('" +
-				$(obj).parent().attr("book") +
-				"' ,'" +
-				$(obj).parent().attr("para") +
-				"' ,'" +
-				$(obj).parent().attr("begin") +
-				"' ,'" +
-				$(obj).parent().attr("end") +
-				"' ,'" +
-				iterator.id +
-				"',this)";
-			html += '">' + iterator.name;
-			if (parseInt(iterator.power) < 20) {
-				html += "(建议)";
+		if (iterator.status > 0) {
+			if (_channal.indexOf(iterator.id) < 0) {
+				html += '<li onclick="';
+				html +=
+					"new_sentence('" +
+					$(obj).parent().attr("book") +
+					"' ,'" +
+					$(obj).parent().attr("para") +
+					"' ,'" +
+					$(obj).parent().attr("begin") +
+					"' ,'" +
+					$(obj).parent().attr("end") +
+					"' ,'" +
+					iterator.id +
+					"',this)";
+				html += '">' + iterator.name;
+				if (parseInt(iterator.power) < 20) {
+					html += "(建议)";
+				}
+				html += "</li>";
 			}
-			html += "</li>";
 		}
 	}
 	html += "</ul>";