Skip to content

Commit

Permalink
fix(dropdown): adjust for better compatibility with universal
Browse files Browse the repository at this point in the history
Closes #1883
  • Loading branch information
Taras gaidukov authored and pkozlowski-opensource committed Nov 24, 2017
1 parent cbecb2d commit 9ad8f43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ export class NgbDropdownMenu {

applyPlacement(_placement: Placement) {
// remove the current placement classes
this._renderer.removeClass(this._elementRef.nativeElement.parentElement, 'dropup');
this._renderer.removeClass(this._elementRef.nativeElement.parentElement, 'dropdown');
this._renderer.removeClass(this._elementRef.nativeElement.parentNode, 'dropup');
this._renderer.removeClass(this._elementRef.nativeElement.parentNode, 'dropdown');
this.placement = _placement;
/**
* apply the new placement
* in case of top use up-arrow or down-arrow otherwise
*/
if (_placement.search('^top') !== -1) {
this._renderer.addClass(this._elementRef.nativeElement.parentElement, 'dropup');
this._renderer.addClass(this._elementRef.nativeElement.parentNode, 'dropup');
} else {
this._renderer.addClass(this._elementRef.nativeElement.parentElement, 'dropdown');
this._renderer.addClass(this._elementRef.nativeElement.parentNode, 'dropdown');
}
}
}
Expand Down

0 comments on commit 9ad8f43

Please sign in to comment.