Browse Source

Merge pull request #790 from visuddhinanda/laravel

:bug: 逐词译上下对读译文框太高
visuddhinanda 4 years ago
parent
commit
4a8621eb71
2 changed files with 17 additions and 5 deletions
  1. 12 4
      public/app/article/article.js
  2. 5 1
      public/app/studio/js/common.js

+ 12 - 4
public/app/article/article.js

@@ -395,10 +395,18 @@ function palicanon_load() {
 						$("#article_author").html(result.username.nickname + "@" + result.username.username);
 						$("#article_author").html(result.username.nickname + "@" + result.username.username);
 						$("#contents").html(note_init(result.content));
 						$("#contents").html(note_init(result.content));
 						note_refresh_new(function () {
 						note_refresh_new(function () {
-							document.querySelector("#para_focus").scrollIntoView({
-								block: "end",
-								behavior: "smooth",
-							});
+                            if(document.querySelector("#para_focus")){
+                                document.querySelector("#para_focus").scrollIntoView({
+                                    block: "end",
+                                    behavior: "smooth",
+                                });                                
+                            }
+
+                            $.get('templiates/glossary.tpl',function(data){
+                                let TermData = term_get_used();
+                                let rendered = Mustache.render(data,TermData);
+                                $("#glossary").html(rendered);                                
+                            });
 						});
 						});
 						reader_draw_para_menu();
 						reader_draw_para_menu();
 						guide_init();
 						guide_init();

+ 5 - 1
public/app/studio/js/common.js

@@ -171,12 +171,16 @@ function setArrange(mode) {
 		getStyleClass("trandiv").style.flex = "1";
 		getStyleClass("trandiv").style.flex = "1";
 		getStyleClass("pardiv").style.flexDirection = "column";
 		getStyleClass("pardiv").style.flexDirection = "column";
 		getStyleClass("sent_wbw_trans").style.flexDirection = "column";
 		getStyleClass("sent_wbw_trans").style.flexDirection = "column";
+        	$(".translate_sent_head").each(function(){
+                    $(this).height('auto')
+                });
 	} else if (_display_para_arrange == 0) {
 	} else if (_display_para_arrange == 0) {
 		/* 0 左右对读 */
 		/* 0 左右对读 */
 		getStyleClass("wbwdiv").style.flex = "7";
 		getStyleClass("wbwdiv").style.flex = "7";
 		getStyleClass("trandiv").style.flex = "3";
 		getStyleClass("trandiv").style.flex = "3";
 		getStyleClass("pardiv").style.flexDirection = "row";
 		getStyleClass("pardiv").style.flexDirection = "row";
 		getStyleClass("sent_wbw_trans").style.flexDirection = "row";
 		getStyleClass("sent_wbw_trans").style.flexDirection = "row";
+	    $(".translate_sent_head").each(function(){$(this).height($(this).parent()[0].scrollHeight+"px")})
 	}
 	}
 	if (_display_sbs == 1) {
 	if (_display_sbs == 1) {
 		/* 逐句对读 */
 		/* 逐句对读 */
@@ -633,7 +637,7 @@ function tab_click(panalId, tabid, callback = null, parm = null) {
 		}
 		}
 	}
 	}
 	guide_init();
 	guide_init();
-	$(".translate_sent_head").each(function(){$(this).height($(this).parent()[0].scrollHeight+"px")})
+
 }
 }
 
 
 /*
 /*