mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
Fixes alertview when displaying more than 2 buttons
This commit is contained in:
@ -223,6 +223,7 @@ $alert-md-buttons-justify-content: flex-end !default;
|
||||
background-color: $alert-md-button-background-color;
|
||||
border-radius: $alert-md-button-border-radius;
|
||||
text-transform: uppercase;
|
||||
text-align: right;
|
||||
|
||||
&.activated {
|
||||
opacity: 1;
|
||||
|
@ -69,6 +69,11 @@ ion-alert {
|
||||
.alert-button-group {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
&.vertical {
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.alert-button {
|
||||
|
@ -277,7 +277,7 @@ export class Alert extends ViewController {
|
||||
'</template>' +
|
||||
|
||||
'</div>' +
|
||||
'<div class="alert-button-group">' +
|
||||
'<div class="alert-button-group" [ngClass]="{vertical: d.buttons.length>2}">' +
|
||||
'<button *ngFor="#b of d.buttons" (click)="btnClick(b)" [ngClass]="b.cssClass" class="alert-button">' +
|
||||
'{{b.text}}' +
|
||||
'</button>' +
|
||||
|
@ -51,6 +51,25 @@ class E2EPage {
|
||||
});
|
||||
}
|
||||
|
||||
doAlertLongMessage() {
|
||||
let alert = Alert.create({
|
||||
title: 'Alert',
|
||||
message: 'Message <strong>text</strong>!!!',
|
||||
buttons: ['Cancel', 'Continue to grant access']
|
||||
});
|
||||
this.nav.present(alert);
|
||||
}
|
||||
|
||||
doMultipleButtons() {
|
||||
let alert = Alert.create({
|
||||
title: 'Alert',
|
||||
subTitle: 'Subtitle',
|
||||
message: 'This is an alert message.',
|
||||
buttons: ['Cancel', 'Continue', 'Delete']
|
||||
});
|
||||
this.nav.present(alert);
|
||||
}
|
||||
|
||||
doPrompt() {
|
||||
let alert = Alert.create();
|
||||
alert.setTitle('Prompt!');
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
<ion-navbar *navbar>
|
||||
<ion-title>Alerts</ion-title>
|
||||
</ion-navbar>
|
||||
@ -6,6 +5,8 @@
|
||||
<ion-content padding>
|
||||
|
||||
<button block class="e2eOpenAlert" (click)="doAlert()">Alert</button>
|
||||
<button block class="e2eOpenAlertLongMessage" (click)="doAlertLongMessage()">Alert Long Message</button>
|
||||
<button block class="e2eOpenMultipleButtons" (click)="doMultipleButtons()">Multiple Buttons (>2)</button>
|
||||
<button block class="e2eOpenConfirm" (click)="doConfirm()">Confirm</button>
|
||||
<button block class="e2eOpenPrompt" (click)="doPrompt()">Prompt</button>
|
||||
<button block class="e2eOpenRadio" (click)="doRadio()">Radio</button>
|
||||
@ -23,4 +24,4 @@
|
||||
Checkbox Result: {{testCheckboxResult}}
|
||||
</pre>
|
||||
|
||||
</ion-content>
|
||||
</ion-content>
|
Reference in New Issue
Block a user