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

Commit

Permalink
fix(select, mdUtil): better support for margin layout on disableScroll
Browse files Browse the repository at this point in the history
  • Loading branch information
rschmukler committed Apr 17, 2015
1 parent ecbbd86 commit 3c0ce9b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,16 @@ angular.module('material.core')

var restoreStyle = disableTarget.attr('style');
var computedStyle = $window.getComputedStyle(disableTarget[0]);
var disableRect = disableTarget[0].getBoundingClientRect();

var widthOffset = disableRect.left + parseFloat(computedStyle.paddingLeft, 10) - parseFloat(computedStyle.marginLeft, 10);



computeScrollbars(computedStyle);

wrapperEl.attr('layout-margin', disableTarget.attr('layout-margin'));

wrapperEl.css({
overflow: 'hidden',
position: 'fixed',
Expand All @@ -88,7 +96,10 @@ angular.module('material.core')
'-ms-flex': computedStyle.msFlex,
flex: computedStyle.flex,
'padding-top': computedStyle.paddingTop,
'margin-top': '0px',
'margin-left': computedStyle.marginLeft,
top: (-1 * heightOffset) + 'px',
left: widthOffset + 'px',
width: '100%'
});

Expand Down

0 comments on commit 3c0ce9b

Please sign in to comment.