fix #1239 on('changeScrollTop') argument is an object instead of number

This commit is contained in:
nightwing 2013-02-09 15:36:01 +04:00
commit 2f55065e84
3 changed files with 34 additions and 33 deletions

View file

@ -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);
};
/**