Skip to content

Commit

Permalink
Improve speed of compute responsive. Closes #499.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshadfield committed Feb 20, 2018
1 parent 85d993c commit e7069e1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/util/computeResponsive.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,7 @@ const computeResponsive = ({
const horizontalPadding = horizontal === 1 ? 34 : 56; // derived from empirical testing, depends on Card margins
const verticalPadding = 52;

/* WIDTH */
let scrollbarWidth = 0; // sidebar scrollbar has width equal to its offsetWidth - clientWidth
const classArray = document.getElementsByClassName("sidebar");
if (classArray.length > 0) {
scrollbarWidth = classArray[0].offsetWidth - classArray[0].clientWidth;
}
const LRpadding = padding.left + padding.right + horizontalPadding + scrollbarWidth + (padding.left + padding.right === 0 ? 0 : controlsPadding);
const LRpadding = padding.left + padding.right + horizontalPadding + (padding.left + padding.right === 0 ? 0 : controlsPadding);
const width = horizontal * (browserDimensions.width - LRpadding);

/* HEIGHT */
Expand Down

0 comments on commit e7069e1

Please sign in to comment.