diff --git a/addon/lint/lint.js b/addon/lint/lint.js index 0eac8d12a1..f36a232978 100644 --- a/addon/lint/lint.js +++ b/addon/lint/lint.js @@ -16,7 +16,10 @@ var tt = document.createElement("div"); tt.className = "CodeMirror-lint-tooltip cm-s-" + cm.options.theme; tt.appendChild(content.cloneNode(true)); - document.body.appendChild(tt); + if(cm.options.lint.selfContain) + cm.getWrapperElement().appendChild(tt); + else + document.body.appendChild(tt); function position(e) { if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position); diff --git a/demo/lint.html b/demo/lint.html index 1184232d43..4b245dc54c 100644 --- a/demo/lint.html +++ b/demo/lint.html @@ -150,7 +150,9 @@
lintOnChange: false
option to disable that.
+ You can pass a selfContain: true
option to render the tooltip inside the editor instance.
Depends on addon/lint/lint.css
. A demo can be
found here.