Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Issues with action sheet

$
0
0

@LouisR wrote:

Hi

I have an action sheet to confirm the log out in my app. But it doesn't work well:

  1. there's only one option (logout), whereas there should be two (logout or cancel)
  2. when I click on "logout" the action sheet doesn't close itself.

controllers.js:

$scope.showLogOutMenu = function() {
    var hideSheet = $ionicActionSheet.show({
      titleText: 'Are you sure you want to logout?',
      buttons: [
        { text: '<i class="icon ion-log-out balanced"></i> Logout' },
        { text: '<i class="icon ion-close-circled assertive"></i> Cancel' },
      ],
      destructiveText: 'Logout',
      cancelText: 'Cancel',
      cancel: function() {},
      buttonClicked: function(index) {
        return true;
      },
      destructiveButtonClicked: function(){
        $ionicLoading.show({
          template: 'Logging out...'
        });

        // Facebook logout
        facebookConnectPlugin.logout(function(){
          $scope.facebookButtonShow = true;
          $scope.googleButtonShow = true;
          $ionicLoading.hide();
        },
        function(fail){
          $ionicLoading.hide();
        });
      }
    });
  };

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>