Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(disableScroll): fix disable scroll creating scrollbar when none e…
Browse files Browse the repository at this point in the history
…xisted
  • Loading branch information
rschmukler committed Jun 25, 2015
1 parent 05119a7 commit 7fe482c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/core/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ angular.module('material.core')
var scrollOffset = body.scrollTop + body.parentElement.scrollTop;
var clientWidth = body.clientWidth;

applyStyles(body, {
position: 'fixed',
width: '100%',
overflowY: 'scroll',
top: -scrollOffset + 'px'
});
if (body.scrollHeight > body.clientHeight) {
applyStyles(body, {
position: 'fixed',
width: '100%',
overflowY: 'scroll',
top: -scrollOffset + 'px'
});
}

applyStyles(htmlNode, {
overflowY: 'hidden'
Expand Down

0 comments on commit 7fe482c

Please sign in to comment.