-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: "outsideClick" still closed the dropdown on any click
- Implement a `DropdownMenu` directive to fix "always undefined directive.menuEl" - Test for "OUTSIDECLICK" should not consider menu children to be outside the menu This fixes #124
- Loading branch information
Showing
3 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import {Dropdown} from './dropdown/dropdown.directive'; | ||
import {DropdownMenu} from './dropdown/dropdown-menu.directive'; | ||
import {DropdownToggle} from './dropdown/dropdown-toggle.directive'; | ||
|
||
export {Dropdown} from './dropdown/dropdown.directive'; | ||
export {DropdownMenu} from './dropdown/dropdown-menu.directive'; | ||
export {DropdownToggle} from './dropdown/dropdown-toggle.directive'; | ||
export const DROPDOWN_DIRECTIVES: Array<any> = [Dropdown, DropdownToggle]; | ||
export const DROPDOWN_DIRECTIVES: Array<any> = [Dropdown, DropdownToggle, DropdownMenu]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { | ||
Directive, ElementRef, Host, | ||
OnInit | ||
} from 'angular2/core'; | ||
|
||
import {Dropdown} from './dropdown.directive'; | ||
|
||
@Directive({ selector: '[dropdownMenu]' }) | ||
export class DropdownMenu implements OnInit { | ||
constructor( @Host() public dropdown: Dropdown, public el: ElementRef) { | ||
} | ||
|
||
public ngOnInit() { | ||
this.dropdown.dropDownMenu = this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters