Skip to content

Commit

Permalink
Merge pull request #263 from schneider-electric-itb-software/add_f-op…
Browse files Browse the repository at this point in the history
…en-dropdown_to_open_dropdown_elements

fix(dropdown): added f-dropdown-open to open dropdown element
  • Loading branch information
jbrowning committed Oct 13, 2015
2 parents dce7a48 + e9f736c commit 3d04829
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/dropdownToggle/dropdownToggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ angular.module('mm.foundation.dropdownToggle', [ 'mm.foundation.position', 'mm.f

if (!elementWasOpen && !element.hasClass('disabled') && !element.prop('disabled')) {
dropdown.css('display', 'block'); // We display the element so that offsetParent is populated
dropdown.addClass('f-open-dropdown');

var offset = $position.offset(element);
var parentOffset = $position.offset(angular.element(dropdown[0].offsetParent));
var dropdownWidth = dropdown.prop('offsetWidth');
Expand Down Expand Up @@ -82,6 +84,7 @@ angular.module('mm.foundation.dropdownToggle', [ 'mm.foundation.position', 'mm.f
closeMenu = function (event) {
$document.off('click', closeMenu);
dropdown.css('display', 'none');
dropdown.removeClass('f-open-dropdown');
element.removeClass('expanded');
closeMenu = angular.noop;
openElement = null;
Expand Down

0 comments on commit 3d04829

Please sign in to comment.