Browse Source

ScrollBar: cache bar width calculation

Leopoldthecoder 8 years ago
parent
commit
869600f4d5
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/utils/scrollbar-width.js

+ 2 - 1
src/utils/scrollbar-width.js

@@ -23,6 +23,7 @@ export default function() {
 
   const widthWithScroll = inner.offsetWidth;
   outer.parentNode.removeChild(outer);
+  scrollBarWidth = widthNoScroll - widthWithScroll;
 
-  return widthNoScroll - widthWithScroll;
+  return scrollBarWidth;
 };