user6039980
user6039980

Reputation: 3506

Ionic: How is it possible to change the width of $ionicPopup?

I'm trying to change the width of $ionicPopup; I've tried using the following css code, to import it onto cssClass: my-popup:

.my-popup {
      width: 400;
      }

But that didn't seem to work.

I've really got stuck there, and currently unable to find a solution.

Any help will be much appreciated. Thank you.

Upvotes: 0

Views: 3861

Answers (2)

niczak
niczak

Reputation: 3917

It's actually quite straight forward, see the following example:

var pinPopup = $ionicPopup.show({
    templateUrl : 'app/user-profile/user-pin.html',
    title: '4-digit Security PIN',
    scope : $scope,
    cssClass: 'my-popup',
    buttons : [
        {
            text : 'Cancel',
        },
        {
            text : '<b>Save</b>',
            type: 'button-positive',
            onTap : function(e) {
                var val = document.getElementById('pin-output').value;
                $scope.userRow.password = val;
            }
        }
    ]
})

Now in your CSS simply do:

.my-popup .popup {
  width: 400px;
}

Upvotes: 2

Euler
Euler

Reputation: 36

Place the following in the src/theme/variables.scss file;

$popover-ios-width: 300px;

Upvotes: 2

Related Questions