fix #1239 on('changeScrollTop') argument is an object instead of number
This commit is contained in:
parent
c6ba1957aa
commit
2f55065e84
3 changed files with 34 additions and 33 deletions
|
|
@ -997,11 +997,11 @@ var EditSession = function(text, mode) {
|
|||
**/
|
||||
this.setScrollTop = function(scrollTop) {
|
||||
scrollTop = Math.round(Math.max(0, scrollTop));
|
||||
if (this.$scrollTop === scrollTop)
|
||||
if (this.$scrollTop === scrollTop || isNaN(scrollTop))
|
||||
return;
|
||||
|
||||
this.$scrollTop = scrollTop;
|
||||
this._emit("changeScrollTop", scrollTop);
|
||||
this._signal("changeScrollTop", scrollTop);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -1018,11 +1018,11 @@ var EditSession = function(text, mode) {
|
|||
**/
|
||||
this.setScrollLeft = function(scrollLeft) {
|
||||
scrollLeft = Math.round(Math.max(0, scrollLeft));
|
||||
if (this.$scrollLeft === scrollLeft)
|
||||
if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))
|
||||
return;
|
||||
|
||||
this.$scrollLeft = scrollLeft;
|
||||
this._emit("changeScrollLeft", scrollLeft);
|
||||
this._signal("changeScrollLeft", scrollLeft);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue