Explorar el Código

Merge pull request #1017 from bhikkhu-kosalla-china/laravel

气泡显示优化
Bhikkhu China Kosalla hace 3 años
padre
commit
e4b5b04a42

+ 3 - 3
public/app/guide/guide.css

@@ -14,7 +14,6 @@ guide {
 }
 guide:hover .guide_contence {
 	display: inline-block;
-	white-space: nowrap;
     width: fit-content;
     max-width: unset;
 }
@@ -28,7 +27,7 @@ guide ol {
 }
 .guide_contence {
 	/*border-top: 7px;*/
-	position: absolute;
+	position: fixed;
 	border: 1px solid var(--border-line-color);
 	border-radius: 5px;
 	top: 100%;
@@ -46,9 +45,10 @@ guide ol {
 	box-shadow: 0px 3px 13px 0px var(--shadow-color);
 	color: var(--main-color);
 	z-index: 200;
+}
+.nsy_word .guide_contence{
 	white-space: nowrap;
 }
-
 .guide_contence:after {
 	content: "\00a0";
 	width: 0;

+ 18 - 4
public/app/guide/guide.js

@@ -5,18 +5,32 @@ function guide_init() {
 				$(this).css("background", "unset");
 			}
 			if ($(this).offset().left < $(document.body).width() / 2) {
-				$(this).append('<div  class="guide_contence left" style="right: max('+($(this).offset().left+$(this).width()+30-$(document.body).width())+'px,-20em);left: -5px;"></div>');
+				$(this).append('<div class="guide_contence"></div>');
+				//$(this).append('<div  class="guide_contence left" style="right: max('+($(this).offset().left+$(this).width()+30-$(document.body).width())+'px,-20em);left: -5px;"></div>');
 				//$(this).after().css("left", +($(this).offset().left-$(this).parent().offset().left)+"px");
 			} else {
-				$(this).append('<div  class="guide_contence right" style="left: '+($(this).parent().offset().left-$(this).offset().left)+'px;right:-5px"></div>');
+				//$(this).append('<div  class="guide_contence"></div>');
+				$(this).append('<div  class="guide_contence right" style="right:-5px"></div>');
+				//$(this).append('<div  class="guide_contence right" style="left: '+($(this).parent().offset().left-$(this).offset().left)+'px;right:-5px"></div>');
 				//$(this).after().css("right", ($(this).parent().offset().left+$(this).parent().width()+13-$(this).offset().left-$(this).width())+"px");
 			}
 			$(this).attr("init", "1");
 		}
 	});
 
-	$("guide").mouseenter(function () {
-		if ($(this).children(".guide_contence").first().html().length > 0) {
+	$("guide").mouseenter(function (event) {
+		let mouse_x=event.clientX
+		let mouse_y=event.clientY
+	if ($(this).offset().left < $(document.body).width() / 2) {//左边
+		$(this).children(".guide_contence").first().css("left",(mouse_x-20)+"px")
+		$(this).children(".guide_contence").first().css("top",mouse_y+"px")
+		$(this).children(".guide_contence").first().css("max-width",($(document.body).width()-mouse_x-20)+"px")
+	} else {//右边
+		$(this).children(".guide_contence").first().css("right",($(document.body).width()-mouse_x-20)+"px")
+		$(this).children(".guide_contence").first().css("top",mouse_y+"px")
+		$(this).children(".guide_contence").first().css("max-width",(mouse_x-20)+"px")
+	}
+	if ($(this).children(".guide_contence").first().html().length > 0) {
 			return;
 		}
 		let gid = $(this).attr("gid");

+ 7 - 7
public/app/palicanon/chapter_channel.js

@@ -42,7 +42,7 @@ function render_chapter_progress_list(chapterList,param) {
                 }
             }
             html += "<li>";
-            html += "<span clsss='channel_name' style='flex:2;'>";
+            html += "<span class='channel_name' style='flex:2;'>";
             html += "<a href='../article/?view=chapter&book="+iterator.book+"&par="+iterator.para+"&channel="+iterator.channel.uid+"' target='_blanck'>";
             html += iterator.channel.name;
             html += "</a>";
@@ -71,11 +71,11 @@ function render_chapter_progress_list_readonly(chapterList,param) {
 	let html = "";
     html += "<ul class='chapter_info_list'>";
 	html += "<li>";
-	html += "<span clsss='channel_name' >版本</span>";
-	html += "<span clsss='progress_bar' >进度</span>";
-	html += "<span clsss='views' >阅读</span>";
-	html += "<span clsss='likes' >点赞</span>";
-	html += "<span clsss='updated_at' >更新于</span>";
+	html += "<span class='channel_name' >版本</span>";
+	html += "<span class='progress_bar' >进度</span>";
+	html += "<span class='views' >阅读</span>";
+	html += "<span class='likes' >点赞</span>";
+	html += "<span class='updated_at' >更新于</span>";
 	html += "</li>";
 
 	for (const iterator of chapterList) {
@@ -86,7 +86,7 @@ function render_chapter_progress_list_readonly(chapterList,param) {
                 }
             }
             html += "<li>";
-            html += "<span clsss='channel_name' style='flex:3;'>";
+            html += "<span class='channel_name' style='flex:3;'>";
             html += "<a href='../article/?view=chapter&book="+iterator.book+"&par="+iterator.para+"&channel="+iterator.channel.uid+"' target='_blanck'>";
             html += iterator.channel.name;
             html += "</a>";

+ 2 - 2
public/app/term/popup_note.css

@@ -29,7 +29,7 @@ code ol {
 }
 .popup_contence {
 	border-top: 7px;
-	position: absolute;
+	position: fixed;
 	border: 1px solid var(--border-line-color);
 	border-radius: 5px;
 	top: 180%;
@@ -43,9 +43,9 @@ code ol {
 	font-size: 10pt;
 	text-align: left;
 	display: none;
-
 	margin: 0.3em;
 	margin: -1px 0px;
+	margin-top: 10px;
 	box-shadow: 0px 3px 13px 0px var(--shadow-color);
 	color: var(--main-color);
 	z-index: 200;

+ 10 - 0
public/app/term/popup_note.js

@@ -16,4 +16,14 @@ function popup_init() {
 			$(this).attr("init", "1");
 		}
 	});
+	$("code").mouseenter(function (event) {
+		let mouse_x=event.clientX - 20
+		let mouse_y=event.clientY
+		$(this).children(".popup_contence").first().css("left",mouse_x+"px")
+		$(this).children(".popup_contence").first().css("top",mouse_y+"px")
+	if ($(this).children(".popup_contence").first().html().length > 0) {
+			return;
+		}
+	});
+	
 }

+ 6 - 2
public/app/term/term.css

@@ -491,6 +491,7 @@ note:hover .add_new {
 	display: none;
 	max-height: 50vh;
 	overflow: scroll;
+	margin-top: 2em;
 }
 .tool_bar {
 	display: flex;
@@ -765,9 +766,13 @@ pw {
     display: block;
 }
 
+.other_tran .sent_tran_inner{
+    padding-top: calc(8px + 2.1em);
+	position: relative;
+}
 
 .sent_tran.commentary>.sent_tran_inner{
-    padding-top: 2.2em;
+    padding-top: calc(8px + 2.1em);
 	position: relative;
 }
 .body > .edit {
@@ -1181,7 +1186,6 @@ ul {
 .nsy_word>.meaning{
     display:inline;
     font-weight: 400;
-	white-space: nowrap;
 }
 .nsy_word>.org>strong {
     font-weight:900;

+ 6 - 2
public/app/term/term_popup.js

@@ -26,8 +26,12 @@ function term_popup_init() {
     }
   });
 
-  $(".term_link").mouseenter(function () {
-    if ($(this).children(".guide_contence").first().html().length > 0) {
+  $(".term_link").mouseenter(function (event) {
+	let mouse_x=event.clientX - 20
+	let mouse_y=event.clientY
+	$(this).children(".guide_contence").first().css("left",mouse_x+"px")
+	$(this).children(".guide_contence").first().css("top",mouse_y+"px")
+if ($(this).children(".guide_contence").first().html().length > 0) {
       return;
     }
     let gid = $(this).attr("gid");

+ 1 - 1
public/app/users_guide/zh-cn/grammar_acc.md

@@ -2,6 +2,6 @@
 
 |语种|缩写|全称|
 |-|-|-|
-|巴利|——|Upayoga-vacana\(常见于注释书\)<br>dutiyā-vibhatti\(常见于语法书\)|
+|巴利|——|Upayoga-vacana<br>(常见于注释书)<br>dutiyā-vibhatti<br>(常见于语法书)|
 |汉|**宾**|宾格<br>业格<br>受格<br>对格<br>第二变格|
 |英|**acc.**|accusative case|

+ 1 - 1
public/app/users_guide/zh-cn/grammar_inst.md

@@ -2,6 +2,6 @@
 
 |语种|缩写|全称|
 |-|-|-|
-|巴利|na|Karaṇa-vacana\(常见于注释书\)<br>tatiyā-vibhatti\(常见于语法书\)|
+|巴利|na|Karaṇa-vacana<br>\(常见于注释书\)<br>tatiyā-vibhatti<br>\(常见于语法书\)|
 |汉|**具**|工具格<br>具作格<br>具格<br>第三变格|
 |英|**inst.**<br>instr.|instrumental case|