More action sheet styles and animations

This commit is contained in:
Max Lynch
2013-11-12 23:55:48 -06:00
parent 3f89bca290
commit a7330cdd41
6 changed files with 120 additions and 20 deletions

View File

@ -21,7 +21,7 @@ angular.module('ionic.ui.actionSheet', [])
});
},
template: '<div class="action-sheet-backdrop">' +
'<div class="action-sheet slide-in-up">' +
'<div class="action-sheet action-sheet-up">' +
'<div class="action-sheet-group">' +
'<div class="action-sheet-title" ng-if="titleText">{{titleText}}</div>' +
'<button class="button" ng-click="buttonClicked($index)" ng-repeat="button in buttons">{{button.text}}</button>' +

View File

@ -1,7 +1,7 @@
angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ionic.ui.actionSheet', 'ngAnimate'])
.factory('ActionSheet', ['$rootScope', '$document', '$compile', '$animate', 'TemplateLoader',
function($rootScope, $document, $compile, $animate, TemplateLoader) {
.factory('ActionSheet', ['$rootScope', '$document', '$compile', '$animate', '$timeout', 'TemplateLoader',
function($rootScope, $document, $compile, $animate, $timeout, TemplateLoader) {
return {
/**
@ -30,8 +30,11 @@ angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ioni
opts.cancel();
}
});
$animate.removeClass(element, 'active', function() {
scope.$destroy();
$timeout(function() {
$animate.removeClass(element, 'active', function() {
scope.$destroy();
});
});
};

View File

@ -15,7 +15,7 @@
<script src="../../../../dist/js/ionic.js"></script>
<script src="../../../../dist/js/ionic-angular.js"></script>
<script>
angular.module('actionTest', ['ionic'])
angular.module('actionTest', ['ionic', 'ngAnimate'])
.controller('ActionCtrl', function($scope, ActionSheet) {
$scope.show = function() {