Make WordPress Core


Ignore:
Timestamp:
06/06/2012 09:45:17 PM (13 years ago)
Author:
koopersmith
Message:

Theme Customizer: Fix scrolling on iOS and Kindle Fire. props azaozz, helenyhou. fixes #20805.

Also fixes uploader UIs on iOS and Kindle Fire by improving wp.Uploader.
Adds mobile viewport specifications.
Moves scrollbar back to fixed positioning.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/customize.php

    r21010 r21014  
    3535_wp_admin_html_begin();
    3636
     37$body_class = '';
     38
     39if ( wp_is_mobile() ) :
     40    $body_class .= ' mobile';
     41
     42    ?><meta name="viewport" id="viewport-meta" content="width=device-width, initial-scale=0.8, minimum-scale=0.5, maximum-scale=1.2"><?php
     43endif;
     44
     45$is_ios = wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] );
     46
     47if ( $is_ios )
     48    $body_class .= ' ios';
     49
    3750$admin_title = sprintf( __( '%1$s &#8212; WordPress' ), strip_tags( sprintf( __( 'Customize %s' ), $wp_customize->theme()->display('Name') ) ) );
    3851?><title><?php echo $admin_title; ?></title><?php
     
    4255?>
    4356</head>
    44 <body class="wp-full-overlay">
     57<body class="<?php echo esc_attr( $body_class ); ?>">
     58<div class="wp-full-overlay expanded">
    4559    <form id="customize-controls" class="wrap wp-full-overlay-sidebar">
    4660        <?php wp_nonce_field( 'customize_controls-' . $wp_customize->get_stylesheet() ); ?>
     
    141155            'fallback'      => $fallback_url,
    142156        ),
     157        'browser'  => array(
     158            'mobile' => wp_is_mobile(),
     159            'ios'    => $is_ios,
     160        ),
    143161        'settings' => array(),
    144162        'controls' => array(),
     
    161179        var _wpCustomizeSettings = <?php echo json_encode( $settings ); ?>;
    162180    </script>
     181</div>
    163182</body>
    164183</html>
Note: See TracChangeset for help on using the changeset viewer.