-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dialog): add configurable width, height and position (#1848)
* Adds the ability to set a dialog's `width` and `height`. * Adds the ability to set a dialog's position. If only the position in one axis is overridden, the other axis will stay centered. * Fixes the `GlobalPositionStrategy` adding an unnecessary `0px` transform. * Makes the dialog scrollable. * Adds more options to the dialog demo so it's easier to test them out. Fixes #1698.
- Loading branch information
1 parent
5ac29dd
commit bc6cf6e
Showing
10 changed files
with
253 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,32 @@ | ||
<h1>Dialog demo</h1> | ||
|
||
<button (click)="open()" [disabled]="dialogRef">Open dialog</button> | ||
<button md-raised-button color="primary" (click)="open()" [disabled]="dialogRef">Open dialog</button> | ||
|
||
<p> | ||
Last close result: {{lastCloseResult}} | ||
</p> | ||
<md-card class="demo-dialog-card"> | ||
<md-card-content> | ||
<h2>Dialog dimensions</h2> | ||
|
||
<p> | ||
<md-input [(ngModel)]="config.width" placeholder="Width"></md-input> | ||
<md-input [(ngModel)]="config.height" placeholder="Height"></md-input> | ||
</p> | ||
|
||
<h2>Dialog position</h2> | ||
|
||
<p> | ||
<md-input [(ngModel)]="config.position.top" (change)="config.position.bottom = ''" placeholder="Top"></md-input> | ||
<md-input [(ngModel)]="config.position.bottom" (change)="config.position.top = ''" placeholder="Bottom"></md-input> | ||
</p> | ||
|
||
<p> | ||
<md-input [(ngModel)]="config.position.left" (change)="config.position.right = ''" placeholder="Left"></md-input> | ||
<md-input [(ngModel)]="config.position.right" (change)="config.position.left = ''" placeholder="Right"></md-input> | ||
</p> | ||
|
||
<h2>Other options</h2> | ||
|
||
<md-checkbox [(ngModel)]="config.disableClose">Disable close</md-checkbox> | ||
</md-card-content> | ||
</md-card> | ||
|
||
<p>Last close result: {{lastCloseResult}}</p> |
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,3 +1,8 @@ | ||
.demo-dialog { | ||
color: rebeccapurple; | ||
} | ||
|
||
.demo-dialog-card { | ||
max-width: 350px; | ||
margin: 20px 0; | ||
} |
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
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