Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
fix(macPopover): Fix always switching to aligning right
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlee44 committed Jan 2, 2016
1 parent bf03f6b commit 34d94c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/directives/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ angular.module('Mac').directive('macPopover', [
* Element directive to define popover
*
* @param {String} id Modal id
* @param {String} mac-popover-refresh-on Event to update popover size and position
* @param {Bool} mac-popover-footer Show footer or not
* @param {Bool} mac-popover-header Show header or not
* @param {String} mac-popover-title Popover title
* @param {String} mac-popover-direction Popover direction (default "above left")
* @param {String} mac-popover-refresh-on Event to update popover size and position
* - above, below or middle - Place the popover above, below or center align the trigger element
* - left or right - Place tip on the left or right of the popover
*/
Expand Down
2 changes: 1 addition & 1 deletion src/services/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ angular.module('Mac').provider('popover', function () {
action = {remove: 'right', add: 'left'};

// Left align originally, switch to right
} else if (offset.left + calculatedOffset.left + currentPopover.outerWidth() - leftScroll) {
} else if (offset.left + calculatedOffset.left + currentPopover.outerWidth() - leftScroll > $window.width()) {
action = {remove: 'left', add: 'right'};
}

Expand Down

0 comments on commit 34d94c5

Please sign in to comment.