Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ion-side-menu-content does not adjust switching portrait/landscape mode #5214

Closed
beatgrabe opened this issue Jan 27, 2016 · 9 comments
Closed

Comments

@beatgrabe
Copy link

My application does not adjust the ion-side-menu-content while switching between portrait and landscape mode. I could observe this issue running the application on an iPad with expose-aside-when="large" with an permanent open ion-side-menu. So starting the application in landscape keeps my content width on portrait mode, but it should be decreased. Starting in portrait mode and switching to landscape should increase the width of ion-side-menu-content. Apparently it does not work!

Futher information:
ionic: 1.2.4.
cordova: 5.4.1
cordova-ios: 3.9.2

Viewport:

<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"/>
@lordgreg
Copy link

I'm having the same issue. What I'll currently do is, watch on resize or rotation event, and manually recalucalte ion-content where I find ion-side-menu-content.

@beatgrabe
Copy link
Author

Nice hint! That's what i have done so far:

window.addEventListener( "orientationchange", recalculateWidth );
function recalculateWidth( event ) {
    var amount = parseInt( angular.element( "ion-side-menu" )[ 0 ].style.width, 10 );
    var total = parseInt( window.innerWidth, 10 );
    angular.element( "ion-side-menu-content" )[ 0 ].style.width = total - amount + "px";
}

@lordgreg
Copy link

lordgreg commented Feb 1, 2016

@beat-at-hartwig - just updated your code a bit. When switching different sites with such a content, you can have more than one ion-side-menu-content. That's why I suggest you create .length variable and use the for loop and update the width of all occurrences of ion-side-menu-content that you find.

👍

@0pt1m1z3r
Copy link

+1

@jgw96 jgw96 added the menus label Mar 14, 2016
@leonardobazico
Copy link

+1

@jgw96 jgw96 added css labels Mar 31, 2016
@GenesioValois
Copy link

+1

@felly
Copy link

felly commented Apr 7, 2016

Maybe a duplicate of #4898?

@beatgrabe
Copy link
Author

Good to know. Have not seen it yet. Thanks. I will give it a try!

@adamdbradley adamdbradley removed the bug label Apr 12, 2016
@jgw96 jgw96 added the v1 label Apr 26, 2016
@beatgrabe
Copy link
Author

Can be closed due to fixes and merges in #4908 and #4898!

@jgw96 jgw96 closed this as completed Jul 21, 2016
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants