Skip to content

Commit

Permalink
fixed: dropdown selector to search through the whole page and wrap th…
Browse files Browse the repository at this point in the history
…e result within an angular element
  • Loading branch information
OSLO-Gargaroz committed Sep 6, 2017
1 parent d29a0e7 commit 0247c1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions angular-scroll-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

// change dropdown position if click on button
button.bind('click', function() {
var dropdown = elm.find('body .dropdown-menu-scoll:visible');
var dropDownTopInBottom = button.offset().top + button.outerHeight() - $window.pageYOffset;
var dropDownTopInTop = button.offset().top - $window.pageYOffset;
var dropdown = angular.element($.find('body .dropdown-menu-scoll:visible'));
var dropDownTopInBottom = button.offset().top + button.outerHeight() - $window.pageYOffset;
var dropDownTopInTop = button.offset().top - $window.pageYOffset;

if (dropdown.height() > dropDownTopInTop) {
dropdown.css('top', Math.floor(dropdown.height() - dropDownTopInTop - button.outerHeight(true)) + "px");
Expand Down

0 comments on commit 0247c1f

Please sign in to comment.