Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the dropdown-menu class to dropdown menus (#541) #732

Merged
merged 1 commit into from
Jul 14, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion components/dropdown/dropdown-menu.directive.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import {Directive, ElementRef, Host, OnInit} from '@angular/core';
import {Directive, ElementRef, Host, OnInit, HostBinding} from '@angular/core';
import {DropdownDirective} from './dropdown.directive';

@Directive({selector: '[dropdownMenu]'})
export class DropdownMenuDirective implements OnInit {
public dropdown:DropdownDirective;
public el:ElementRef;

/* tslint:disable:no-unused-variable */
@HostBinding('class.dropdown-menu')
public addClass:boolean = true;
/* tslint:enable:no-unused-variable */

public constructor(@Host() dropdown:DropdownDirective, el:ElementRef) {
this.dropdown = dropdown;
this.el = el;
Expand Down
2 changes: 1 addition & 1 deletion components/dropdown/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { DROPDOWN_DIRECTIVES } from 'ng2-bootstrap/components/dropdown';
```html
<!-- dropdown directive marks a dropdown root element -->
<div dropdown>
<!-- click on dropdown-toggle toogles dropdown state, optional -->
<!-- click on dropdown-toggle toggles dropdown state, optional -->
<div dropdownToggle></div>
<!-- dropdown-menu holds content which will be shown -->
<div dropdownMenu>
Expand Down
2 changes: 1 addition & 1 deletion demo/components/dropdown/dropdown-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<button id="single-button" type="button" class="btn btn-primary" dropdownToggle [disabled]="disabled">
Button dropdown <span class="caret"></span>
</button>
<ul class="dropdown-menu" dropdownMenu role="menu" aria-labelledby="single-button">
<ul dropdownMenu role="menu" aria-labelledby="single-button">
<li role="menuitem"><a class="dropdown-item" href="#">Action</a></li>
<li role="menuitem"><a class="dropdown-item" href="#">Another action</a></li>
<li role="menuitem"><a class="dropdown-item" href="#">Something else here</a></li>
Expand Down