From 5be42bc3c7ea7f136b3639e228960ce85a981d08 Mon Sep 17 00:00:00 2001 From: Tim Lancina Date: Fri, 9 May 2014 09:15:20 -0500 Subject: [PATCH] add height=device-height on Cordova iOS 7.0 --- js/utils/viewport.js | 4 ++++ test/unit/utils/viewport.unit.js | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/js/utils/viewport.js b/js/utils/viewport.js index 23e14a25cd..65dd6ea1b9 100644 --- a/js/utils/viewport.js +++ b/js/utils/viewport.js @@ -94,6 +94,10 @@ function viewportUpdate() { // iPhone <= 6.1 WebView // if height was set it needs to get removed with this hack for <= 6.1 if( initHeight ) viewportProperties.height = '0'; + + } else if(version == 7) { + //iPhone == 7.0 WebView + viewportProperties.height = DEVICE_HEIGHT; } } else { diff --git a/test/unit/utils/viewport.unit.js b/test/unit/utils/viewport.unit.js index ea50c7238e..2777d2a402 100644 --- a/test/unit/utils/viewport.unit.js +++ b/test/unit/utils/viewport.unit.js @@ -322,10 +322,10 @@ describe('Ionic Viewport', function() { vportTag.content = 'user-scalable=no, width=device-width, height=device-height'; viewportLoadTag(); - expect( vportTag.content ).toEqual('user-scalable=no, width=device-width'); + expect( vportTag.content ).toEqual('user-scalable=no, width=device-width, height=device-height'); }); - it('Should add width, but not height to viewport for iOS 7.0, iPhone, WebView', function(){ + it('Should add width and height to viewport for iOS 7.0, iPhone, WebView', function(){ ionic.Platform.setPlatform('iOS'); ionic.Platform.setVersion('7.0'); window.cordova = {}; @@ -333,7 +333,7 @@ describe('Ionic Viewport', function() { vportTag.content = 'user-scalable=no'; viewportLoadTag(); - expect( vportTag.content ).toEqual('user-scalable=no, width=device-width'); + expect( vportTag.content ).toEqual('user-scalable=no, width=device-width, height=device-height'); });