This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 771
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fxShow, fxHide): support fxHide+fxShow usages on same element (#190)
* chore(gitignore): ignore yarn changes * fix(fxHide, fxShow): allow fxHide+fxShow usages on same element * also export the **BaseFxDirectiveAdapter** class
- Loading branch information
1 parent
0797c85
commit eee20b2
Showing
14 changed files
with
219 additions
and
627 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
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
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
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,32 +1,37 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demos-github-issues', | ||
template: ` | ||
selector: 'demos-github-issues', | ||
template: ` | ||
<demo-issue-5345></demo-issue-5345> | ||
<demo-issue-9897></demo-issue-9897> | ||
<demo-issue-181></demo-issue-181> | ||
` | ||
}) | ||
export class DemosGithubIssues { } | ||
export class DemosGithubIssues { | ||
} | ||
|
||
import {NgModule} from '@angular/core'; | ||
import {CommonModule} from "@angular/common"; | ||
import {MaterialModule} from "@angular/material"; | ||
import {FlexLayoutModule} from "../../../lib"; // `gulp build:components` to deploy to node_modules manually | ||
|
||
import { DemoIssue5345 } from "./issue.5345.demo"; | ||
import { DemoIssue9897 } from "./issue.9897.demo"; | ||
import {DemoIssue5345} from "./issue.5345.demo"; | ||
import {DemoIssue9897} from "./issue.9897.demo"; | ||
import {DemoIssue181} from './issue.181.demo'; | ||
|
||
@NgModule({ | ||
declarations : [ | ||
declarations: [ | ||
DemosGithubIssues, // used by the Router with the root app component | ||
DemoIssue5345, | ||
DemoIssue9897 | ||
DemoIssue9897, | ||
DemoIssue181 | ||
], | ||
imports : [ | ||
imports: [ | ||
CommonModule, | ||
MaterialModule, | ||
FlexLayoutModule | ||
] | ||
}) | ||
export class DemosGithubIssuesModule{ } | ||
export class DemosGithubIssuesModule { | ||
} |
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,58 @@ | ||
import {Component, OnDestroy} from '@angular/core'; | ||
import {Subscription} from "rxjs/Subscription"; | ||
import 'rxjs/add/operator/filter'; | ||
|
||
import {MediaChange} from "../../../lib/media-query/media-change"; | ||
import {ObservableMedia} from "../../../lib/media-query/observable-media-service"; | ||
|
||
@Component({ | ||
selector: 'demo-issue-181', | ||
styleUrls: [ | ||
'../demo-app/material2.css' | ||
], | ||
template: ` | ||
<md-card class="card-demo" > | ||
<md-card-title><a href="https://github.com/angular/flex-layout/issues/181" target="_blank">Issue #181</a></md-card-title> | ||
<md-card-subtitle>Wrong layout when fxHide + fxShow usages do not cooperate properly:</md-card-subtitle> | ||
<md-card-content> | ||
<div class="containerX"> | ||
<div class="coloredContainerX box fixed" | ||
[fxLayout]="direction" | ||
(click)="pivot()"> | ||
<div fxHide fxShow.gt-xs class="box1"> Type 1, row a, fxHide fxShow.gt-xs </div> | ||
<div fxHide fxShow.gt-xs class="box2"> Type 1, row b, fxHide fxShow.gt-xs </div> | ||
<div fxHide fxShow.gt-xs class="box3"> Type 1, row c, fxHide fxShow.gt-xs </div> | ||
<div fxShow fxHide.md class="box1"> Type 2, row a, fxShow fxHide.md</div> | ||
<div fxShow fxHide.md class="box2"> Type 2, row b, fxShow fxHide.md</div> | ||
<div fxShow fxHide.md class="box3"> Type 2, row c, fxShow fxHide.md</div> | ||
</div> | ||
</div> | ||
</md-card-content> | ||
<md-card-footer style="width:95%;padding-left:20px;margin-top:-5px;"> | ||
<div class="hint" >Active mediaQuery: <span style="padding-left: 20px; color: rgba(0, 0, 0, 0.54)">{{ activeMediaQuery }}</span></div> | ||
</md-card-footer> | ||
</md-card> | ||
` | ||
}) | ||
export class DemoIssue181 implements OnDestroy { | ||
public direction = "column"; | ||
public activeMediaQuery = ""; | ||
|
||
constructor(media$: ObservableMedia) { | ||
this._watcher = media$.subscribe((change: MediaChange) => { | ||
let value = change ? `'${change.mqAlias}' = (${change.mediaQuery})` : ""; | ||
this.activeMediaQuery = value; | ||
}); | ||
} | ||
|
||
pivot() { | ||
this.direction = (this.direction === "row") ? "column" : "row"; | ||
} | ||
|
||
ngOnDestroy() { | ||
this._watcher.unsubscribe(); | ||
} | ||
|
||
private _watcher: Subscription; | ||
} |
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
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
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
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
Oops, something went wrong.