refactor(popover): popover-top as the default

This commit is contained in:
Adam Bradley
2014-09-14 21:08:21 -05:00
parent 95d3f2e3c9
commit 0420e6eb2d
2 changed files with 6 additions and 11 deletions

View File

@@ -101,10 +101,10 @@ function($ionicModal, $ionicPosition, $document, $window) {
// make it pop up
if (buttonOffset.top + buttonOffset.height + popoverHeight > bodyHeight) {
popoverCSS.top = buttonOffset.top - popoverHeight;
popoverEle.removeClass('popover-top').addClass('popover-bottom');
popoverEle.addClass('popover-bottom');
} else {
popoverCSS.top = buttonOffset.top + buttonOffset.height;
popoverEle.removeClass('popover-bottom').addClass('popover-top');
popoverEle.removeClass('popover-bottom');
}
arrowEle.css({

View File

@@ -25,6 +25,7 @@
left: 50%;
z-index: $z-index-popover;
display: block;
margin-top: 12px;
margin-left: -$popover-width / 2;
height: $popover-height;
width: $popover-width;
@@ -40,9 +41,6 @@
border-bottom: 0;
}
&.popover-top {
margin-top: 12px;
}
&.popover-bottom {
margin-top: -12px;
}
@@ -92,6 +90,7 @@
.popover-arrow {
position: absolute;
display: block;
top: -17px;
width: 30px;
height: 19px;
overflow: hidden;
@@ -108,10 +107,8 @@
@include rotate(-45deg);
}
}
.popover-top .popover-arrow {
top: -17px;
}
.popover-bottom .popover-arrow {
top: auto;
bottom: -10px;
&:after {
top: -6px;
@@ -124,6 +121,7 @@
.platform-android {
.popover {
margin-top: -32px;
background-color: $popover-bg-color-android;
box-shadow: $popover-box-shadow-android;
@@ -132,9 +130,6 @@
background-color: $popover-bg-color-android;
color: #4d4d4d;
}
&.popover-top {
margin-top: -32px;
}
&.popover-bottom {
margin-top: 32px;
}