Skip to content

Commit

Permalink
refactor(popover): popover-top as the default
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Sep 15, 2014
1 parent 95d3f2e commit 0420e6e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions js/angular/service/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
13 changes: 4 additions & 9 deletions scss/_popover.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,9 +41,6 @@
border-bottom: 0;
}

&.popover-top {
margin-top: 12px;
}
&.popover-bottom {
margin-top: -12px;
}
Expand Down Expand Up @@ -92,6 +90,7 @@
.popover-arrow {
position: absolute;
display: block;
top: -17px;
width: 30px;
height: 19px;
overflow: hidden;
Expand All @@ -108,10 +107,8 @@
@include rotate(-45deg);
}
}
.popover-top .popover-arrow {
top: -17px;
}
.popover-bottom .popover-arrow {
top: auto;
bottom: -10px;
&:after {
top: -6px;
Expand All @@ -124,6 +121,7 @@
.platform-android {

.popover {
margin-top: -32px;
background-color: $popover-bg-color-android;
box-shadow: $popover-box-shadow-android;

Expand All @@ -132,9 +130,6 @@
background-color: $popover-bg-color-android;
color: #4d4d4d;
}
&.popover-top {
margin-top: -32px;
}
&.popover-bottom {
margin-top: 32px;
}
Expand Down

0 comments on commit 0420e6e

Please sign in to comment.