ANimationed action sheet!

This commit is contained in:
Max Lynch
2013-10-04 23:55:10 -05:00
parent 2938e104c2
commit 5cc7070c03
9 changed files with 42 additions and 12 deletions

View File

@ -10,7 +10,7 @@ angular.module('ionic.ui.actionSheet', [])
$element.remove();
});
},
template: '<div class="action-sheet">' +
template: '<div class="action-sheet slide-in-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

@ -16,7 +16,8 @@ angular.module('ionic.service.actionSheet', ['ionic.service', 'ionic.ui.actionSh
angular.extend(scope, opts);
scope.cancel = function() {
scope.$destroy();
scope.sheet.hide();
//scope.$destroy();
opts.cancel();
}
@ -24,7 +25,8 @@ angular.module('ionic.service.actionSheet', ['ionic.service', 'ionic.ui.actionSh
// Check if the button click event returned true, which means
// we can close the action sheet
if((opts.buttonClicked && opts.buttonClicked(index)) === true) {
scope.$destroy();
scope.sheet.hide();
//scope.$destroy();
}
};
@ -32,7 +34,8 @@ angular.module('ionic.service.actionSheet', ['ionic.service', 'ionic.ui.actionSh
// Check if the destructive button click event returned true, which means
// we can close the action sheet
if((opts.destructiveButtonClicked && opts.destructiveButtonClicked()) === true) {
scope.$destroy();
scope.sheet.hide();
//scope.$destroy();
}
}
@ -43,8 +46,11 @@ angular.module('ionic.service.actionSheet', ['ionic.service', 'ionic.ui.actionSh
$document[0].body.appendChild(element[0]);
var sheet = ionic.views.ActionSheet({el: element[0] });
var sheet = new ionic.views.ActionSheet({el: element[0] });
scope.sheet = sheet;
sheet.show();
return sheet;
}
};