Skip to content

Commit

Permalink
fixed: top offset calculations
Browse files Browse the repository at this point in the history
  • Loading branch information
OSLO-Gargaroz committed Jul 5, 2017
1 parent 3340177 commit 0766757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions angular-scroll-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
var dropDownTopInTop = button.offset().top - $window.pageYOffset;

if ($(window).height() < (dropDownTopInBottom + dropdown.height())) {
dropdown.css('top', (dropDownTopInTop - dropdown.height()) + "px");
dropdown.css('top', (dropDownTopInTop - dropdown.height() - button.outerHeight()) + "px");
} else {
dropdown.css('top', (dropDownTopInBottom) + "px");
}
Expand All @@ -42,7 +42,7 @@
var dropDownTopInTop = button.offset().top - $window.pageYOffset;

if ($(window).height() < (dropDownTopInBottom + dropdown.height())) {
dropdown.css('top', (dropDownTopInTop - dropdown.outerHeight()) + "px");
dropdown.css('top', (dropDownTopInTop - dropdown.height() - button.outerHeight()) + "px");
} else {
dropdown.css('top', (dropDownTopInBottom) + "px");
}
Expand Down

0 comments on commit 0766757

Please sign in to comment.