From b54dbb58abcb41ec11c00c3fae2bc1db9db646fa Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 21 Apr 2017 13:16:53 -0600 Subject: [PATCH] Add missing methods on TextEditorElement --- src/text-editor-element.js | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/text-editor-element.js b/src/text-editor-element.js index e9c0b687f..0bcb60a09 100644 --- a/src/text-editor-element.js +++ b/src/text-editor-element.js @@ -142,10 +142,27 @@ class TextEditorElement extends HTMLElement { getBaseCharacterWidth () { return this.getComponent().getBaseCharacterWidth() } + getMaxScrollTop () { return this.getComponent().getMaxScrollTop() } + getScrollHeight () { + return this.getComponent().getScrollHeight() + } + + getScrollWidth () { + return this.getComponent().getScrollWidth() + } + + getVerticalScrollbarWidth () { + return this.getComponent().getVerticalScrollbarWidth() + } + + getHorizontalScrollbarHeight () { + return this.getComponent().getHorizontalScrollbarHeight() + } + getScrollTop () { return this.getComponent().getScrollTop() } @@ -156,6 +173,14 @@ class TextEditorElement extends HTMLElement { component.scheduleUpdate() } + getScrollBottom () { + return this.getComponent().getScrollBottom() + } + + setScrollBottom (scrollBottom) { + return this.getComponent().setScrollBottom(scrollBottom) + } + getScrollLeft () { return this.getComponent().getScrollLeft() } @@ -166,6 +191,24 @@ class TextEditorElement extends HTMLElement { component.scheduleUpdate() } + getScrollRight () { + return this.getComponent().getScrollRight() + } + + setScrollRight (scrollRight) { + return this.getComponent().setScrollRight(scrollRight) + } + + // Essential: Scrolls the editor to the top. + scrollToTop () { + this.setScrollTop(0) + } + + // Essential: Scrolls the editor to the bottom. + scrollToBottom () { + this.setScrollTop(Infinity) + } + hasFocus () { return this.getComponent().focused }