From cbf59faa062bb14abe2fcd4d6469582807689c31 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Fri, 18 Nov 2016 13:51:33 +0100 Subject: [PATCH] fix(fab): fab list colors fixes #9225 --- src/components/fab/fab.ios.scss | 4 ++-- src/components/fab/fab.md.scss | 4 ++-- src/components/fab/fab.ts | 21 +++++++++++++++++---- src/components/fab/fab.wp.scss | 4 ++-- src/components/fab/test/basic/app-module.ts | 13 +++++++++++-- src/components/fab/test/basic/e2e.ts | 8 ++++++++ src/components/fab/test/basic/main.html | 18 ++++++++++-------- src/util/mock-providers.ts | 2 +- 8 files changed, 53 insertions(+), 21 deletions(-) diff --git a/src/components/fab/fab.ios.scss b/src/components/fab/fab.ios.scss index ba04cbb606d..1c6c747c98f 100755 --- a/src/components/fab/fab.ios.scss +++ b/src/components/fab/fab.ios.scss @@ -31,12 +31,12 @@ $fab-ios-list-button-background-color-activated: color-shade($fab-ios-list-butt background-color: $fab-ios-background-color-activated; } -.fab-ios.fab-in-list { +.fab-ios-in-list { color: $fab-ios-list-button-text-color; background-color: $fab-ios-list-button-background-color; } -.fab-ios.fab-in-list.activated { +.fab-ios-in-list.activated { background-color: $fab-ios-list-button-background-color-activated; } diff --git a/src/components/fab/fab.md.scss b/src/components/fab/fab.md.scss index b2296e35883..4d726b8facc 100755 --- a/src/components/fab/fab.md.scss +++ b/src/components/fab/fab.md.scss @@ -44,12 +44,12 @@ $fab-md-list-button-background-color-activated: color-shade($fab-md-list-butto box-shadow: $fab-md-box-shadow-activated; } -.fab-md.fab-in-list { +.fab-md-in-list { color: $fab-md-list-button-text-color; background-color: $fab-md-list-button-background-color; } -.fab-md.fab-wp.fab-in-list.activated { +.fab-md-in-list.activated { background-color: $fab-md-list-button-background-color-activated; } diff --git a/src/components/fab/fab.ts b/src/components/fab/fab.ts index 3bc7e176829..9cf8f5f9675 100755 --- a/src/components/fab/fab.ts +++ b/src/components/fab/fab.ts @@ -128,14 +128,23 @@ export class FabButton extends Ion { export class FabList { _visible: boolean = false; _fabs: FabButton[] = []; + _mode: string; - constructor(private _elementRef: ElementRef, private _renderer: Renderer) { } + constructor( + private _elementRef: ElementRef, + private _renderer: Renderer, + config: Config + ) { + this._mode = config.get('mode'); + } @ContentChildren(FabButton) set _setbuttons(query: QueryList) { - let fabs = this._fabs = query.toArray(); + const fabs = this._fabs = query.toArray(); + const className = `fab-${this._mode}-in-list`; for (var fab of fabs) { fab.setElementClass('fab-in-list', true); + fab.setElementClass(className, true); } } @@ -284,13 +293,17 @@ export class FabContainer { * @private */ ngAfterContentInit() { - this._events.listen(this._mainButton.getNativeElement(), 'click', this.pointerUp.bind(this)); + if (!this._mainButton || !this._mainButton.getNativeElement()) { + console.error('FAB container needs a main
- + @@ -20,8 +22,8 @@ - - + + @@ -30,8 +32,8 @@ - - + + @@ -40,8 +42,8 @@ - - + + @@ -51,7 +53,7 @@ - + diff --git a/src/util/mock-providers.ts b/src/util/mock-providers.ts index d08177bc38b..f8730ef9af0 100644 --- a/src/util/mock-providers.ts +++ b/src/util/mock-providers.ts @@ -378,7 +378,7 @@ export const mockTabs = function(app?: App): Tabs { export const mockMenu = function (): Menu { let app = mockApp(); let gestureCtrl = new GestureController(app); - return new Menu(null, null, null, null, null, null, null, gestureCtrl); + return new Menu(null, null, null, null, null, null, null, gestureCtrl, app); }; export const mockDeepLinkConfig = function(links?: any[]): DeepLinkConfig {