2
0
Эх сурвалжийг харах

CodeEditor: better display for errors

lviguier 9 сар өмнө
parent
commit
3ad18b0fce

+ 4 - 1
bin/style.css

@@ -2842,10 +2842,13 @@ div.sp-container input:hover {
   background: #500505;
   color: red;
   position: absolute;
-  margin-top: -20px;
+  bottom: 0px;
   padding: 2px;
   right: 13px;
   border: 1px solid #A00;
+  max-height: 200px;
+  max-width: 400px;
+  overflow: hidden;
 }
 .script-editor .codeeditor {
   height: 100%;

+ 4 - 1
bin/style.less

@@ -3262,10 +3262,13 @@ div.sp-container {
 		background : rgba(80, 5, 5, 1);
 		color : red;
 		position: absolute;
-		margin-top : -20px;
+		bottom: 0px;
 		padding: 2px;
 		right : 13px;
 		border: 1px solid #A00;
+		max-height: 200px;
+		max-width: 400px;
+		overflow: hidden;
 	}
 }
 

+ 3 - 1
hide/comp/CodeEditor.hx

@@ -148,7 +148,9 @@ class CodeEditor extends Component {
 			{ range : range, options : { inlineClassName: "codeErrorContentLine", isWholeLine : true } },
 			{ range : range, options : { linesDecorationsClassName: "codeErrorLine", inlineClassName: "codeErrorContent" } }
 		]);
-		errorMessage.html([for( l in msg.split("\n") ) StringTools.htmlEscape(l)].join("<br/>"));
+		var errStr = '${[for( l in msg.split("\n") ) StringTools.htmlEscape(l)].join("<br/>")}';
+		errorMessage.html(errStr);
+		errorMessage.prop('title', errStr);
 		errorMessage.toggle(true);
 		var rect = errorMessage[0].getBoundingClientRect();
 		if( rect.bottom > js.Browser.window.innerHeight )