add height=device-height on Cordova iOS 7.0

This commit is contained in:
Tim Lancina
2014-05-09 09:15:20 -05:00
parent d108a29e58
commit 5be42bc3c7
2 changed files with 7 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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');
});