Add a getModel method to editors' hidden input component

...to make it easy to access the editor in response to DOM events or
when using document.activeElement.

Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
Antonio Scandurra
2016-11-11 19:38:54 +01:00
committed by Nathan Sobo
parent 31eb91c0a7
commit 5a45461d60

View File

@@ -72,6 +72,10 @@ class TextEditorComponent
@hiddenInputComponent = new InputComponent
@scrollViewNode.appendChild(@hiddenInputComponent.getDomNode())
# Add a getModel method to the hidden input component to make it easy to
# access the editor in response to DOM events or when using
# document.activeElement.
@hiddenInputComponent.getDomNode().getModel = => @editor
@linesComponent = new LinesComponent({@presenter, @domElementPool, @assert, @grammars, @views})
@scrollViewNode.appendChild(@linesComponent.getDomNode())