mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
ANimationed action sheet!
This commit is contained in:
@ -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>' +
|
||||
|
||||
14
js/ext/angular/src/service/ionicActionSheet.js
vendored
14
js/ext/angular/src/service/ionicActionSheet.js
vendored
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user