Skip to content

Commit

Permalink
refactoring of scrollbar hiding specific css
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Grsmto committed Apr 17, 2017
1 parent a7bdc52 commit 8a94e27
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/simplebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,12 @@ export default class SimpleBar {
this.scrollbarX = this.trackX.querySelector(`.${this.classNames.scrollbar}`);
this.scrollbarY = this.trackY.querySelector(`.${this.classNames.scrollbar}`);

this.scrollContentEl.style.paddingRight = `${this.offsetSize}px`;
this.scrollContentEl.style.marginBottom = `-${this.offsetSize}px`;
this.scrollContentEl.style.paddingRight = `${this.scrollbarWidth || this.offsetSize}px`;
this.scrollContentEl.style.marginBottom = `-${this.scrollbarWidth*2 || this.offsetSize}px`;
this.contentEl.style.paddingBottom = `${this.scrollbarWidth || this.offsetSize}px`;

if (this.scrollbarWidth !== 0) {
this.scrollContentEl.style.marginBottom = `-${this.scrollbarWidth*2}px`;
this.contentEl.style.marginRight = `-${this.scrollbarWidth}px`;
this.contentEl.style.paddingBottom = `${this.scrollbarWidth}px`;
} else {
this.contentEl.style.paddingBottom = `${this.offsetSize}px`;
}

// Calculate content size
Expand Down

0 comments on commit 8a94e27

Please sign in to comment.