add scrollTo method
This commit is contained in:
parent
27b91b44e0
commit
2cef7f4747
1 changed files with 10 additions and 2 deletions
|
|
@ -1292,12 +1292,20 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.$loop.schedule(this.CHANGE_H_SCROLL);
|
this.$loop.schedule(this.CHANGE_H_SCROLL);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scrolls the editor across both x- and y-axes.
|
||||||
|
* @param {Number} x The x value to scroll to
|
||||||
|
* @param {Number} y The y value to scroll to
|
||||||
|
**/
|
||||||
|
this.scrollTo = function(x, y) {
|
||||||
|
this.session.setScrollTop(y);
|
||||||
|
this.session.setScrollLeft(y);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scrolls the editor across both x- and y-axes.
|
* Scrolls the editor across both x- and y-axes.
|
||||||
* @param {Number} deltaX The x value to scroll by
|
* @param {Number} deltaX The x value to scroll by
|
||||||
* @param {Number} deltaY The y value to scroll by
|
* @param {Number} deltaY The y value to scroll by
|
||||||
*
|
|
||||||
*
|
|
||||||
**/
|
**/
|
||||||
this.scrollBy = function(deltaX, deltaY) {
|
this.scrollBy = function(deltaX, deltaY) {
|
||||||
deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);
|
deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue