mirror of
https://github.com/moparisthebest/mail
synced 2024-11-26 10:52:17 -05:00
Close dropdown after selection has been made
This commit is contained in:
parent
8cc84ef8c6
commit
fc66df8894
@ -119,6 +119,9 @@ ngModule.directive('woDropdown', function($document, $timeout) {
|
||||
|
||||
elm.on('touchstart click', toggle);
|
||||
|
||||
// close if user clicks button in dropdown list
|
||||
dropdown.on('touchstart.woDropdown click.woDropdown', 'button', disappear);
|
||||
|
||||
// close if user clicks outside of dropdown and elm
|
||||
$document.on('touchstart.woDropdown click.woDropdown', function(e) {
|
||||
var t = angular.element(e.target);
|
||||
@ -132,6 +135,7 @@ ngModule.directive('woDropdown', function($document, $timeout) {
|
||||
// remove event listener on document
|
||||
scope.$on('$destroy', function() {
|
||||
$document.off('touchstart.woDropdown click.woDropdown');
|
||||
dropdown.off('touchstart.woDropdown click.woDropdown');
|
||||
});
|
||||
};
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user