Add missing methods on TextEditorElement

This commit is contained in:
Nathan Sobo
2017-04-21 13:16:53 -06:00
committed by Antonio Scandurra
parent 44539b1dc6
commit b54dbb58ab

View File

@@ -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
}