refactor(ionSlideBox): fall back to element.parentNode or nothing for height

This commit is contained in:
Andrew
2014-10-08 15:58:14 -06:00
parent 0d2f54e6a9
commit 38b20cd3ac

View File

@@ -98,8 +98,8 @@ function($ionicSlideBoxDelegate, $window) {
// We just make it so the slidebox is *always* as large as its offsetParent.
function repositionSlideBox() {
element.css({
width: element[0].offsetParent.offsetWidth + 'px',
height: element[0].offsetParent.offsetHeight + 'px'
width: (element[0].offsetParent || element[0].parentNode || {}).offsetWidth + 'px',
height: (element[0].offsetParent || element[0].parentNode || {}).offsetHeight + 'px'
});
}