diff --git a/assets/css/lint.css b/assets/css/lint.css index 079faf3..29f6f14 100644 --- a/assets/css/lint.css +++ b/assets/css/lint.css @@ -14,14 +14,10 @@ position: fixed; white-space: pre; white-space: pre-wrap; + margin: 0 0 0 5px; z-index: 100; max-width: 600px; opacity: 0; - transition: opacity .4s; - -moz-transition: opacity .4s; - -webkit-transition: opacity .4s; - -o-transition: opacity .4s; - -ms-transition: opacity .4s; } .CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { diff --git a/assets/js/icecoder.js b/assets/js/icecoder.js index 266d82c..26ca91d 100644 --- a/assets/js/icecoder.js +++ b/assets/js/icecoder.js @@ -741,6 +741,8 @@ var ICEcoder = { // Show function args tooltip functionArgsTooltip: function(e, area) { + let numLintErrors; + if (this.indexData) { // If we have no files open, return early if (0 === this.openFiles.length) { @@ -776,7 +778,15 @@ var ICEcoder = { if (1 === numResults && -1 === [null, "def"].indexOf(cM.getTokenTypeAt(coordsChar))) { get('tooltip').style.display = "block"; get('tooltip').style.left = (this.mouseX - this.maxFilesW + 10) + "px"; - get('tooltip').style.top = (this.mouseY - 30) + "px"; + numLintErrors = this.content.contentWindow.document.getElementsByClassName("CodeMirror-lint-tooltip")[0]; + numLintErrors = numLintErrors && numLintErrors.childNodes + ? numLintErrors.childNodes.length + : 0; + get('tooltip').style.top = (this.mouseY - 30 - + (0 < numLintErrors + ? 18 * numLintErrors + : 0) + ) + "px"; get('tooltip').style.zIndex = "1"; get('tooltip').innerHTML = result.params; // Else hide it