-
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.
* show demo how to span multiple rows and columns
- Loading branch information
1 parent
ae3a358
commit f9dd674
Showing
4 changed files
with
77 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.containerX { | ||
padding: 5px; | ||
border: solid 1px #b6b6b6; | ||
box-sizing: content-box !important; | ||
} | ||
|
||
.flexitem { | ||
text-align: center; | ||
line-height: 100px; | ||
margin: 2px; | ||
box-shadow: none !important; | ||
padding: 0 !important; | ||
} | ||
|
||
.markup { | ||
font-size: 0.7em; | ||
margin-top: -80px; | ||
font-weight: bold; | ||
} | ||
|
||
.card-demo md-card, | ||
.card-demo md-card-content { | ||
margin-bottom: 24px; | ||
} | ||
|
||
.card-demo md-card-footer { | ||
left: 24px; | ||
margin-bottom: 24px; | ||
} |
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,43 @@ | ||
import {Component, ViewEncapsulation} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'demo-grid-area-row-span', | ||
styleUrls : [ | ||
'gridArea.demo.css', | ||
'../demo-app/material2.css' | ||
], | ||
template: ` | ||
<md-card class="card-demo" > | ||
<md-card-title> <a href="http://stackoverflow.com/questions/37039029/flex-css-rowspan-2-and-colspan-2" target="_blank">StackOverflow</a></md-card-title> | ||
<md-card-subtitle>Grid Area with Column and Row Span... [Click to change direction!]</md-card-subtitle> | ||
<md-card-content> | ||
<div class="containerX" (click)="toggleDirection()" [fx-layout]="'row'+direction" > | ||
<div fx-flex [fx-layout]="'column'"> | ||
<div class="one flexitem " fx-flex> A </div> | ||
<div class="two flexitem " fx-flex> B </div> | ||
<div class="three flexitem " fx-flex> C </div> | ||
</div> | ||
<div fx-flex="67" [fx-layout]="'column'+direction"> | ||
<div fx-layout="row" fx-flex="33%"> | ||
<div class="five flexitem " fx-flex> E </div> | ||
<div class="five flexitem " fx-flex> F </div> | ||
</div> | ||
<div class="four flexitem " fx-flex> D </div> | ||
</div> | ||
</div> | ||
</md-card-content> | ||
<md-card-footer class="bottomPad"> | ||
<div class="hint" >Current direction: <fx-layout="row{{ direction }}"></div> | ||
</md-card-footer> | ||
</md-card> | ||
` | ||
}) | ||
export class DemoGridAreaRowSpan { | ||
direction = ""; | ||
|
||
toggleDirection() { | ||
let next = (DIRECTIONS.indexOf(this.direction) +1 ) % DIRECTIONS.length; | ||
this.direction = DIRECTIONS[next]; | ||
} | ||
} | ||
const DIRECTIONS = ['', '-reverse']; |