Merge branch 'alextrs-master'

This commit is contained in:
Adam Bradley
2014-12-12 22:05:42 -06:00
2 changed files with 13 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
var POPUP_TPL =
'<div class="popup-container">' +
'<div class="popup-container" ng-class="class">' +
'<div class="popup">' +
'<div class="popup-head">' +
'<h3 class="popup-title" ng-bind-html="title"></h3>' +
@@ -138,6 +138,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
* class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -176,6 +177,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
* class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -204,6 +206,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
* class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -242,6 +245,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* ```
* {
* title: '', // String. The title of the popup.
* class: '', // String, The custom CSS class name
* subTitle: '', // String (optional). The sub-title of the popup.
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
@@ -306,6 +310,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
title: options.title,
buttons: options.buttons,
subTitle: options.subTitle,
class: options.class,
$buttonTapped: function(button, event) {
var result = (button.onTap || angular.noop)(event);
event = event.originalEvent || event; //jquery events

View File

@@ -52,6 +52,13 @@ describe('$ionicPopup service', function() {
var popupBody = popup.element[0].querySelector('.popup-body');
expect(popupBody).toBe(null);
});
it('should set the specified custom CSS class to popup container', function() {
var popup = TestUtil.unwrapPromise($ionicPopup._createPopup({
template: 'Hello, friend!',
class: 'mycustomclass'
}));
expect(popup.element.hasClass('mycustomclass')).toBe(true);
});
describe('$buttonTapped', function() {
var popup;