From 3b55889310ea1ba392d3b02909d4e9affc09aa3f Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Fri, 12 Dec 2014 19:43:55 +0100 Subject: web: disable autoscroll at top --- libmproxy/web/static/js/app.js | 6 +++++- web/src/js/utils.js | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libmproxy/web/static/js/app.js b/libmproxy/web/static/js/app.js index d7c07089..230ff6e3 100644 --- a/libmproxy/web/static/js/app.js +++ b/libmproxy/web/static/js/app.js @@ -2,7 +2,11 @@ var AutoScrollMixin = { componentWillUpdate: function () { var node = this.getDOMNode(); - this._shouldScrollBottom = node.scrollTop + node.clientHeight === node.scrollHeight; + this._shouldScrollBottom = ( + node.scrollTop !== 0 + && + node.scrollTop + node.clientHeight === node.scrollHeight + ); }, componentDidUpdate: function () { if (this._shouldScrollBottom) { diff --git a/web/src/js/utils.js b/web/src/js/utils.js index b475980a..7541e98d 100644 --- a/web/src/js/utils.js +++ b/web/src/js/utils.js @@ -2,7 +2,11 @@ var AutoScrollMixin = { componentWillUpdate: function () { var node = this.getDOMNode(); - this._shouldScrollBottom = node.scrollTop + node.clientHeight === node.scrollHeight; + this._shouldScrollBottom = ( + node.scrollTop !== 0 + && + node.scrollTop + node.clientHeight === node.scrollHeight + ); }, componentDidUpdate: function () { if (this._shouldScrollBottom) { -- cgit v1.2.3