chore(popup): Adding ability to pass cssClass

References #183
This commit is contained in:
Brandy Carney
2015-10-01 18:11:25 -04:00
parent 6a1c9aa159
commit 86a8175d3a
2 changed files with 10 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ import * as util from 'ionic/util';
/**
* @name ionPopup
* @name Popup
* @description
* The Ionic Popup service allows programmatically creating and showing popup windows that require the user to respond in order to continue.
*
@@ -77,6 +77,7 @@ export class Popup extends Overlay {
* @returns {TODO} TODO
*/
alert(context={}, opts={}) {
console.log(context, opts);
if (typeof context === 'string') {
context = {
title: context
@@ -84,6 +85,7 @@ export class Popup extends Overlay {
}
let button = {
text: context.okText || 'OK',
type: context.okType || 'primary',
onTap: (event, popupRef) => {
// Allow it to close
//resolve();
@@ -115,12 +117,14 @@ export class Popup extends Overlay {
}
let okButton = {
text: context.okText || 'OK',
type: context.okType || 'primary',
onTap: (event, popupRef) => {
// Allow it to close
}
}
let cancelButton = {
text: context.cancelText || 'Cancel',
type: context.cancelType || 'primary',
isCancel: true,
onTap: (event, popupRef) => {
// Allow it to close
@@ -150,7 +154,7 @@ export class Popup extends Overlay {
}
let okButton = {
text: context.okText || 'OK',
type: context.okType,
type: context.okType || 'primary',
onTap: (event, popupRef) => {
// Allow it to close
}
@@ -158,7 +162,7 @@ export class Popup extends Overlay {
let cancelButton = {
text: context.cancelText || 'Cancel',
type: context.cancelType,
type: context.cancelType || 'primary',
isCancel: true,
onTap: (event, popupRef) => {
// Allow it to close
@@ -202,7 +206,7 @@ const OVERLAY_TYPE = 'popup';
@View({
template:
'<backdrop (click)="_cancel($event)" tappable disable-activated></backdrop>' +
'<popup-wrapper>' +
'<popup-wrapper [ng-class]="cssClass">' +
'<div class="popup-head">' +
'<h2 class="popup-title" [inner-html]="title" *ng-if="title"></h2>' +
'<h3 class="popup-sub-title" [inner-html]="subTitle" *ng-if="subTitle"></h3>' +

View File

@@ -19,7 +19,8 @@ class E2EApp {
this.alertOpen = true;
this.popup.alert({
title: "New Friend!",
template: "Your friend, Obi wan Kenobi, just accepted your friend request!"
template: "Your friend, Obi wan Kenobi, just accepted your friend request!",
cssClass: 'my-alert'
}).then(() => {
this.alertOpen = false;
});