Skip to content

Commit

Permalink
fix(platform): only set isPortrait when the width/height is set
Browse files Browse the repository at this point in the history
  • Loading branch information
brandyscarney committed Jan 10, 2017
1 parent c815074 commit e9adab0
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/platform/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,24 +569,30 @@ export class Platform {

// we're keeping track of portrait and landscape dimensions
// separately because the virtual keyboard can really mess
// up accurate values when the keyboard up
if (win.screen.width < win.screen.height) {
this._isPortrait = true;
if (this._pW < win['innerWidth']) {
this._pW = win['innerWidth'];
}
if (this._pH < win['innerHeight']) {
this._pH = win['innerHeight'];
}
// up accurate values when the keyboard is up
if (win.screen.width > 0 && win.screen.height > 0) {
if (win.screen.width < win.screen.height) {

} else {
this._isPortrait = false;
if (this._lW < win['innerWidth']) {
this._lW = win['innerWidth'];
}
if (this._lH < win['innerHeight']) {
this._lH = win['innerHeight'];
if (this._pW < win['innerWidth']) {
this._isPortrait = true;
this._pW = win['innerWidth'];
}
if (this._pH < win['innerHeight']) {
this._isPortrait = true;
this._pH = win['innerHeight'];
}

} else {
if (this._lW < win['innerWidth']) {
this._isPortrait = false;
this._lW = win['innerWidth'];
}
if (this._lH < win['innerHeight']) {
this._isPortrait = false;
this._lH = win['innerHeight'];
}
}

}
}
}
Expand Down

0 comments on commit e9adab0

Please sign in to comment.