Skip to content

Commit

Permalink
fix(alert): add padding under the alert title for iOS when there is n…
Browse files Browse the repository at this point in the history
…o message

closes #5299
  • Loading branch information
brandyscarney committed Feb 16, 2016
1 parent 0d47a1b commit c365c92
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
6 changes: 6 additions & 0 deletions ionic/components/alert/alert.ios.scss
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ ion-alert {
text-align: $alert-ios-message-text-align;
}

.alert-message {
&:empty {
padding: 0 0 12px 0;
}
}


// iOS Alert Input
// --------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions ionic/components/alert/alert.md.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ $alert-md-buttons-justify-content: flex-end !default;

.alert-message {
font-size: $alert-md-message-font-size;

&:empty {
padding: 0;
}
}


Expand Down
4 changes: 0 additions & 4 deletions ionic/components/alert/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ ion-alert {

.alert-message {
overflow: auto;

&:empty {
padding: 0;
}
}

.alert-input {
Expand Down
6 changes: 5 additions & 1 deletion ionic/components/alert/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export class Alert extends ViewController {
'<h2 id="{{hdrId}}" class="alert-title" *ngIf="d.title" [innerHTML]="d.title"></h2>' +
'<h3 id="{{subHdrId}}" class="alert-sub-title" *ngIf="d.subTitle" [innerHTML]="d.subTitle"></h3>' +
'</div>' +
'<div id="{{msgId}}" class="alert-message" *ngIf="d.message" [innerHTML]="d.message"></div>' +
'<div id="{{msgId}}" class="alert-message" [innerHTML]="d.message"></div>' +
'<div *ngIf="d.inputs.length" [ngSwitch]="inputType">' +

'<template ngSwitchWhen="radio">' +
Expand Down Expand Up @@ -335,6 +335,10 @@ class AlertCmp {
} else if (this.d.subTitle) {
this.descId = this.subHdrId;
}

if (!this.d.message) {
this.d.message = '';
}
}

onPageLoaded() {
Expand Down
2 changes: 1 addition & 1 deletion ionic/components/alert/test/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class E2EPage {
this.nav.present(alert);
}

doAlertNoBody() {
doAlertNoMessage() {
let alert = Alert.create({
title: 'Alert',
buttons: ['OK']
Expand Down
2 changes: 1 addition & 1 deletion ionic/components/alert/test/basic/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<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="e2eOpenAlertNoBody" (click)="doAlertNoBody()">Alert No Body</button>
<button block class="e2eOpenAlertNoMessage" (click)="doAlertNoMessage()">Alert No Message</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>
Expand Down

0 comments on commit c365c92

Please sign in to comment.