@@ -22,27 +22,6 @@ document.addEventListener('deviceready', onDeviceReady, false);
2222
2323function onDeviceReady ( ) {
2424 StatusBar . hide ( ) ;
25-
26- // fix an issue with iOS 12 (@see https://github.com/apache/cordova-ios/issues/417#issuecomment-466520675)
27- function ios12NotchFix ( is_ios , keyboard_plugin_exists ) {
28- if ( ! is_ios || device . model . indexOf ( "iPhone" ) === - 1 ) return false ;
29- if ( ! keyboard_plugin_exists ) throw new Error ( "This fix depends on 'cordova-plugin-keyboard'!" ) ;
30- const iphone_number = Number ( device . model . replace ( "iPhone" , "" ) . replace ( "," , "." ) ) ;
31- const /* viewport metatag */
32- viewport_el = document . getElementsByName ( "viewport" ) [ 0 ] ,
33- default_content = "user-scalable=no, width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" ;
34-
35- if ( iphone_number >= 10.6 || iphone_number === 10.3 ) { /* devices with notch: X, XR, ... */
36- setCover ( ) ;
37-
38- window . addEventListener ( 'keyboardWillShow' , setFix ) ;
39- window . addEventListener ( 'keyboardWillHide' , setCover ) ;
40- }
41- function setCover ( ) { viewport_el . content = default_content + ", viewport-fit=cover" ; }
42- function setFix ( ) { viewport_el . content = default_content ; }
43- }
44-
45- ios12NotchFix ( device . platform === "iOS" , typeof Keyboard !== "undefined" ) ;
4625}
4726
4827document . addEventListener ( 'menubutton' , onMenuButton , false ) ;
0 commit comments