diff --git a/js/ext/angular/src/service/ionicActionSheet.js b/js/ext/angular/src/service/ionicActionSheet.js
index 1989543e03..fdbaf31df0 100644
--- a/js/ext/angular/src/service/ionicActionSheet.js
+++ b/js/ext/angular/src/service/ionicActionSheet.js
@@ -18,7 +18,6 @@ angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ioni
angular.extend(scope, opts);
-
// Compile the template
var element = $compile('')(scope);
@@ -35,6 +34,8 @@ angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ioni
$animate.removeClass(element, 'active', function() {
scope.$destroy();
});
+
+ $document[0].body.classList.remove('action-sheet-open');
};
var onHardwareBackButton = function() {
@@ -70,6 +71,8 @@ angular.module('ionic.service.actionSheet', ['ionic.service.templateLoad', 'ioni
$document[0].body.appendChild(element[0]);
+ $document[0].body.classList.add('action-sheet-open');
+
var sheet = new ionic.views.ActionSheet({el: element[0] });
scope.sheet = sheet;
diff --git a/js/ext/angular/src/service/ionicModal.js b/js/ext/angular/src/service/ionicModal.js
index da73d7a600..1cacb8689f 100644
--- a/js/ext/angular/src/service/ionicModal.js
+++ b/js/ext/angular/src/service/ionicModal.js
@@ -12,8 +12,7 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv
var self = this;
var element = angular.element(this.el);
- document.body.classList.add('disable-pointer-events');
- this.el.classList.add('enable-pointer-events');
+ document.body.classList.add('modal-open');
self._isShown = true;
@@ -76,8 +75,7 @@ angular.module('ionic.service.modal', ['ionic.service.templateLoad', 'ionic.serv
});
function onHideModal(element) {
- document.body.classList.remove('disable-pointer-events');
- element.classList.remove('enable-pointer-events');
+ document.body.classList.remove('modal-open');
}
var createModal = function(templateString, options) {
diff --git a/js/ext/angular/test/modal.html b/js/ext/angular/test/modal.html
index 79ce482420..4752000d89 100644
--- a/js/ext/angular/test/modal.html
+++ b/js/ext/angular/test/modal.html
@@ -43,6 +43,7 @@
+
@@ -82,10 +83,49 @@
})
- .controller('ModalCtrl', function($scope) {
+ .controller('ModalCtrl', function($scope, $ionicActionSheet) {
$scope.close = function() {
$scope.modal.hide();
}
+
+ $scope.openActionSheet = function() {
+ $ionicActionSheet.show({
+
+ // The various non-destructive button choices
+ buttons: [
+ { text: 'Share' },
+ { text: 'Move' },
+ ],
+
+ // The text of the red destructive button
+ destructiveText: 'Delete',
+
+ // The title text at the top
+ titleText: 'Modify your album',
+
+ // The text of the cancel button
+ cancelText: 'Cancel',
+
+ // Called when the sheet is cancelled, either from triggering the
+ // cancel button, or tapping the backdrop, or using escape on the keyboard
+ cancel: function() {
+ },
+
+ // Called when one of the non-destructive buttons is clicked, with
+ // the index of the button that was clicked. Return
+ // "true" to tell the action sheet to close. Return false to not close.
+ buttonClicked: function(index) {
+ return true;
+ },
+
+ // Called when the destructive button is clicked. Return true to close the
+ // action sheet. False to keep it open
+ destructiveButtonClicked: function() {
+ return true;
+ }
+ });
+ };
+
});