* Added Setting
This commit is contained in:
parent
b37304c63b
commit
7f5db3f6b4
2 changed files with 32 additions and 9 deletions
|
|
@ -597,6 +597,14 @@ var Editor = function(renderer, session) {
|
||||||
this.getHighlightSelectedWord = function() {
|
this.getHighlightSelectedWord = function() {
|
||||||
return this.$highlightSelectedWord;
|
return this.$highlightSelectedWord;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setAnimatedScroll = function(shouldAnimate){
|
||||||
|
this.renderer.setAnimatedScroll(shouldAnimate);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getAnimatedScroll = function(){
|
||||||
|
this.rendered.getAnimatedScroll();
|
||||||
|
}
|
||||||
|
|
||||||
this.setShowInvisibles = function(showInvisibles) {
|
this.setShowInvisibles = function(showInvisibles) {
|
||||||
if (this.getShowInvisibles() == showInvisibles)
|
if (this.getShowInvisibles() == showInvisibles)
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,8 @@ var VirtualRenderer = function(container, theme) {
|
||||||
// Indicates whether the horizontal scrollbar is visible
|
// Indicates whether the horizontal scrollbar is visible
|
||||||
this.$horizScroll = true;
|
this.$horizScroll = true;
|
||||||
this.$horizScrollAlwaysVisible = true;
|
this.$horizScrollAlwaysVisible = true;
|
||||||
|
|
||||||
|
this.$animatedScroll = false;
|
||||||
|
|
||||||
this.scrollBar = new ScrollBar(container);
|
this.scrollBar = new ScrollBar(container);
|
||||||
this.scrollBar.addEventListener("scroll", function(e) {
|
this.scrollBar.addEventListener("scroll", function(e) {
|
||||||
|
|
@ -273,6 +275,14 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var limit = Math.floor(availableWidth / this.characterWidth);
|
var limit = Math.floor(availableWidth / this.characterWidth);
|
||||||
return this.session.adjustWrapLimit(limit);
|
return this.session.adjustWrapLimit(limit);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setAnimatedScroll = function(shouldAnimate){
|
||||||
|
this.$animatedScroll = shouldAnimate;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.getAnimatedscroll = function(){
|
||||||
|
return this.$animatedScroll
|
||||||
|
}
|
||||||
|
|
||||||
this.setShowInvisibles = function(showInvisibles) {
|
this.setShowInvisibles = function(showInvisibles) {
|
||||||
if (this.$textLayer.setShowInvisibles(showInvisibles))
|
if (this.$textLayer.setShowInvisibles(showInvisibles))
|
||||||
|
|
@ -723,16 +733,21 @@ var VirtualRenderer = function(container, theme) {
|
||||||
var offset = pos.top;
|
var offset = pos.top;
|
||||||
if (center)
|
if (center)
|
||||||
offset -= this.$size.scrollerHeight / 2;
|
offset -= this.$size.scrollerHeight / 2;
|
||||||
|
|
||||||
var i = 0, _self = this,
|
|
||||||
steps = calcSteps(this.scrollTop, offset);// console.dir(steps);
|
|
||||||
clearInterval(_self.$timer);
|
|
||||||
this.$timer = setInterval(function(){
|
|
||||||
_self.session.setScrollTop(steps[i]);
|
|
||||||
|
|
||||||
if (++i == STEPS + 1)
|
if (this.$animatedScroll) {
|
||||||
clearInterval(_self.$timer);
|
var i = 0, _self = this,
|
||||||
}, 10);
|
steps = calcSteps(this.scrollTop, offset);
|
||||||
|
clearInterval(_self.$timer);
|
||||||
|
this.$timer = setInterval(function(){
|
||||||
|
_self.session.setScrollTop(steps[i]);
|
||||||
|
|
||||||
|
if (++i == STEPS + 1)
|
||||||
|
clearInterval(_self.$timer);
|
||||||
|
}, 10);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.session.setScrollTop(offset);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scrollToY = function(scrollTop) {
|
this.scrollToY = function(scrollTop) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue