aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-03-12 19:00:16 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-03-12 19:00:16 +0100
commitd3a55cd3f064ebfbb4be6ca5655af3736aebefa4 (patch)
treee0a785cde10b64c8cd6c92a5f44b9a5d47353f76
parente0f1f13c14f33eca3f163a89e6e77ae39b174a1f (diff)
parentae61025d5d52b639c4315696ff03162b50b75a8d (diff)
downloadmitmproxy-d3a55cd3f064ebfbb4be6ca5655af3736aebefa4.tar.gz
mitmproxy-d3a55cd3f064ebfbb4be6ca5655af3736aebefa4.tar.bz2
mitmproxy-d3a55cd3f064ebfbb4be6ca5655af3736aebefa4.zip
Merge pull request #1027 from gzzhanghao/vscroll
[web] fix virtual scroll range
-rw-r--r--mitmproxy/web/static/app.js6
-rw-r--r--web/src/js/components/helpers/VirtualScroll.js2
2 files changed, 5 insertions, 3 deletions
diff --git a/mitmproxy/web/static/app.js b/mitmproxy/web/static/app.js
index e318d1ac..527fe225 100644
--- a/mitmproxy/web/static/app.js
+++ b/mitmproxy/web/static/app.js
@@ -2873,6 +2873,8 @@ var _react = require("react");
var _react2 = _interopRequireDefault(_react);
+var _common = require("./common.js");
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
Footer.propTypes = {
@@ -2902,7 +2904,7 @@ function Footer(_ref) {
);
}
-},{"react":"react"}],15:[function(require,module,exports){
+},{"./common.js":4,"react":"react"}],15:[function(require,module,exports){
"use strict";
Object.defineProperty(exports, "__esModule", {
@@ -3505,7 +3507,7 @@ function calcVScroll(opts) {
// Make sure that we start at an even row so that CSS `:nth-child(even)` is preserved
start = Math.max(0, Math.floor(viewportTop / rowHeight) - 1) & ~1;
- end = Math.min(itemCount, start + Math.ceil(viewportHeight / rowHeight) + 1);
+ end = Math.min(itemCount, start + Math.ceil(viewportHeight / rowHeight) + 2);
// When a large trunk of elements is removed from the button, start may be far off the viewport.
// To make this issue less severe, limit the top placeholder to the total number of rows.
diff --git a/web/src/js/components/helpers/VirtualScroll.js b/web/src/js/components/helpers/VirtualScroll.js
index 5d4cf796..d9b31003 100644
--- a/web/src/js/components/helpers/VirtualScroll.js
+++ b/web/src/js/components/helpers/VirtualScroll.js
@@ -57,7 +57,7 @@ export function calcVScroll(opts) {
start = Math.max(0, Math.floor(viewportTop / rowHeight) - 1) & ~1;
end = Math.min(
itemCount,
- start + Math.ceil(viewportHeight / rowHeight) + 1
+ start + Math.ceil(viewportHeight / rowHeight) + 2
);
// When a large trunk of elements is removed from the button, start may be far off the viewport.