kopia lustrzana https://github.com/c9/core
Merge pull request +7244 from c9/fix/tree-pagedown
fix +7206 pressing pagedown screws up the layout of ace treespull/85/head^2
commit
bacef4fd52
|
@ -839,31 +839,45 @@ var VirtualRenderer = function(container, cellWidth, cellHeight) {
|
||||||
|
|
||||||
this.animateScrolling = function(fromValue, callback) {
|
this.animateScrolling = function(fromValue, callback) {
|
||||||
var toValue = this.scrollTop;
|
var toValue = this.scrollTop;
|
||||||
if (this.$animatedScroll && Math.abs(fromValue - toValue) < 100000) {
|
if (!this.$animatedScroll)
|
||||||
var _self = this;
|
return;
|
||||||
var steps = _self.$calcSteps(fromValue, toValue);
|
var _self = this;
|
||||||
this.$inScrollAnimation = true;
|
|
||||||
|
if (fromValue == toValue)
|
||||||
clearInterval(this.$timer);
|
return;
|
||||||
|
|
||||||
_self.provider.setScrollTop(steps.shift());
|
if (this.$scrollAnimation) {
|
||||||
this.$timer = setInterval(function() {
|
var oldSteps = this.$scrollAnimation.steps;
|
||||||
if (steps.length) {
|
if (oldSteps.length) {
|
||||||
_self.setScrollTop(steps.shift());
|
fromValue = oldSteps[0];
|
||||||
// trick provider to think it's already scrolled to not loose toValue
|
if (fromValue == toValue)
|
||||||
_self.scrollTop = toValue;
|
return;
|
||||||
} else if (toValue != null) {
|
}
|
||||||
_self.scrollTop = -1;
|
|
||||||
_self.setScrollTop(toValue);
|
|
||||||
toValue = null;
|
|
||||||
} else {
|
|
||||||
// do this on separate step to not get spurious scroll event from scrollbar
|
|
||||||
_self.$timer = clearInterval(_self.$timer);
|
|
||||||
_self.$inScrollAnimation = false;
|
|
||||||
callback && callback();
|
|
||||||
}
|
|
||||||
}, 10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var steps = _self.$calcSteps(fromValue, toValue);
|
||||||
|
this.$scrollAnimation = {from: fromValue, to: toValue, steps: steps};
|
||||||
|
|
||||||
|
clearInterval(this.$timer);
|
||||||
|
|
||||||
|
_self.provider.setScrollTop(steps.shift());
|
||||||
|
// trick provider to think it's already scrolled to not loose toValue
|
||||||
|
_self.provider.$scrollTop = toValue;
|
||||||
|
this.$timer = setInterval(function() {
|
||||||
|
if (steps.length) {
|
||||||
|
_self.provider.setScrollTop(steps.shift());
|
||||||
|
_self.provider.$scrollTop = toValue;
|
||||||
|
} else if (toValue != null) {
|
||||||
|
_self.provider.$scrollTop = -1;
|
||||||
|
_self.provider.setScrollTop(toValue);
|
||||||
|
toValue = null;
|
||||||
|
} else {
|
||||||
|
// do this on separate step to not get spurious scroll event from scrollbar
|
||||||
|
_self.$timer = clearInterval(_self.$timer);
|
||||||
|
_self.$scrollAnimation = null;
|
||||||
|
callback && callback();
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
"c9.ide.immediate": "#6845a93705",
|
"c9.ide.immediate": "#6845a93705",
|
||||||
"c9.ide.installer": "#19b25fc787",
|
"c9.ide.installer": "#19b25fc787",
|
||||||
"c9.ide.mount": "#896ebf836e",
|
"c9.ide.mount": "#896ebf836e",
|
||||||
"c9.ide.navigate": "#64156c7f4a",
|
"c9.ide.navigate": "#7c58c7f3d7",
|
||||||
"c9.ide.newresource": "#f1f0624768",
|
"c9.ide.newresource": "#f1f0624768",
|
||||||
"c9.ide.openfiles": "#28a4f5af16",
|
"c9.ide.openfiles": "#28a4f5af16",
|
||||||
"c9.ide.preview": "#0bd8dd6e8c",
|
"c9.ide.preview": "#0bd8dd6e8c",
|
||||||
|
|
|
@ -245,7 +245,7 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
function setDefault(name, keys) {
|
function setDefault(name, keys) {
|
||||||
var command = commands[name];
|
var command = commands[name];
|
||||||
|
if (!command) return;
|
||||||
// If bind key is not yet overridden by a custom one
|
// If bind key is not yet overridden by a custom one
|
||||||
if (plugin.commandManager[name] == command.bindKey[platform])
|
if (plugin.commandManager[name] == command.bindKey[platform])
|
||||||
bindKey(keys[platform], command);
|
bindKey(keys[platform], command);
|
||||||
|
|
Ładowanie…
Reference in New Issue