From 0247c1fc08a49cd747526b72087133736837f9d0 Mon Sep 17 00:00:00 2001 From: "AD\\gesposito" Date: Wed, 6 Sep 2017 10:31:43 +0200 Subject: [PATCH] fixed: dropdown selector to search through the whole page and wrap the result within an angular element --- angular-scroll-dropdown.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/angular-scroll-dropdown.js b/angular-scroll-dropdown.js index c9948c6..f980fa5 100644 --- a/angular-scroll-dropdown.js +++ b/angular-scroll-dropdown.js @@ -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");