Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
The fix that was supposed to close this doesn't:

ionic-team@ba39fb0

The real problem was that cancel was being called on opts and not on scope. The code by @ajoslin is redundant as all the three functions he gives a default angular.noop are overloaded 20 lines below so I reverted it.
  • Loading branch information
hallucynogenyc committed Jun 5, 2014
1 parent 53af788 commit bd0137c
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions js/angular/service/actionSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,7 @@ function($rootScope, $document, $compile, $animate, $timeout, $ionicTemplateLoad
show: function(opts) {
var scope = $rootScope.$new(true);

extend(scope, {
cancel: angular.noop,
buttonClicked: angular.noop,
destructiveButtonClicked: angular.noop,
buttons: []
}, opts);
angular.extend(scope, opts);

// Compile the template
var element = $compile('<ion-action-sheet buttons="buttons"></ion-action-sheet>')(scope);
Expand All @@ -94,7 +89,7 @@ function($rootScope, $document, $compile, $animate, $timeout, $ionicTemplateLoad
sheetEl.removeClass('action-sheet-up');
if(didCancel) {
$timeout(function(){
opts.cancel();
scope.cancel();
}, 200);
}

Expand Down

0 comments on commit bd0137c

Please sign in to comment.