fix #1266: Scroller is collapsed when ace initialized with empty value
This commit is contained in:
parent
ad1e74017b
commit
402cdad04b
2 changed files with 8 additions and 6 deletions
|
|
@ -91,7 +91,7 @@ exports.edit = function(el) {
|
|||
var env = {
|
||||
document: doc,
|
||||
editor: editor,
|
||||
onResize: editor.resize.bind(editor)
|
||||
onResize: editor.resize.bind(editor, null)
|
||||
};
|
||||
event.addListener(window, "resize", env.onResize);
|
||||
editor.on("destroy", function() {
|
||||
|
|
|
|||
|
|
@ -262,12 +262,10 @@ var VirtualRenderer = function(container, theme) {
|
|||
*
|
||||
**/
|
||||
this.updateFull = function(force) {
|
||||
if (force){
|
||||
if (force)
|
||||
this.$renderChanges(this.CHANGE_FULL, true);
|
||||
}
|
||||
else {
|
||||
else
|
||||
this.$loop.schedule(this.CHANGE_FULL);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -288,7 +286,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
*
|
||||
**/
|
||||
this.onResize = function(force, gutterWidth, width, height) {
|
||||
var changes = this.CHANGE_SIZE;
|
||||
var changes = 0;
|
||||
var size = this.$size;
|
||||
|
||||
if (this.resizing > 2)
|
||||
|
|
@ -302,6 +300,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
if (height && (force || size.height != height)) {
|
||||
size.height = height;
|
||||
changes = this.CHANGE_SIZE;
|
||||
|
||||
size.scrollerHeight = this.scroller.clientHeight;
|
||||
if (!size.scrollerHeight) {
|
||||
|
|
@ -321,6 +320,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
width = dom.getInnerWidth(this.container);
|
||||
|
||||
if (width && (force || this.resizing > 1 || size.width != width)) {
|
||||
changes = this.CHANGE_SIZE;
|
||||
size.width = width;
|
||||
|
||||
var gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0;
|
||||
|
|
@ -740,6 +740,8 @@ var VirtualRenderer = function(container, theme) {
|
|||
};
|
||||
|
||||
this.$computeLayerConfig = function() {
|
||||
if (!this.$size.scrollerHeight)
|
||||
return this.onResize(true);
|
||||
var session = this.session;
|
||||
|
||||
var offset = this.scrollTop % this.lineHeight;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue