Make WordPress Core

Changeset 27806


Ignore:
Timestamp:
03/28/2014 04:39:04 AM (13 years ago)
Author:
azaozz
Message:

Make DFW usable on touch devices: change the toolbar to two rows and keep it and borders visible. See #26907

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/wp-fullscreen.js

    r27391 r27806  
    9393         * Toggle the CSS class to show/hide the toolbar, borders and statusbar.
    9494         */
    95         toggleUI = api.toggleUI = function( hide ) {
     95        toggleUI = api.toggleUI = function( show ) {
    9696                clearTimeout( uiTimer );
    9797
    98                 if ( ! $body.hasClass('wp-dfw-show-ui') ) {
     98                if ( ! $body.hasClass('wp-dfw-show-ui') || show === 'show' ) {
    9999                        $body.addClass('wp-dfw-show-ui');
    100                 }
    101 
    102                 if ( hide === 'hide' ) {
     100                } else if ( show !== 'autohide' ) {
     101                        $body.removeClass('wp-dfw-show-ui');
     102                }
     103
     104                if ( show === 'autohide' ) {
    103105                        uiTimer = setTimeout( _hideUI, 2000 );
    104106                }
    … …  
    306308                var width;
    307309
     310                if ( pixels && pixels.toString().indexOf('%') !== -1 ) {
     311                        s.$editorContainer.css( 'width', pixels );
     312
     313                        if ( s.$dfwTitle ) {
     314                                s.$dfwTitle.css( 'width', pixels );
     315                        }
     316                        return;
     317                }
     318
    308319                if ( ! pixels ) {
    309                         // reset to theme width
     320                        // Reset to theme width
    310321                        width = $('#wp-fullscreen-body').data('theme-width') || 800;
    311322                        s.$editorContainer.width( width );
    … …  
    366377
    367378                // Show the UI for 2 sec. when opening
    368                 toggleUI('hide');
     379                toggleUI('autohide');
    369380
    370381                api.bind_resize();
    … …  
    374385                }
    375386
    376                 api.dfwWidth( $( '#wp-fullscreen-body' ).data('dfw-width') || 800, true );
     387                if ( 'ontouchstart' in window ) {
     388                        api.dfwWidth( '90%' );
     389                } else {
     390                        api.dfwWidth( $( '#wp-fullscreen-body' ).data('dfw-width') || 800, true );
     391                }
    377392
    378393                // scroll to top so the user is not disoriented
    … …  
    499514                        });
    500515
     516                        if ( 'ontouchstart' in window ) {
     517                                $body.addClass('wp-dfw-touch');
     518                        }
     519
    501520                        toolbar.on( 'mouseenter', function() {
    502521                                toggleUI('show');
    503522                        }).on( 'mouseleave', function() {
    504                                 toggleUI('hide');
     523                                toggleUI('autohide');
    505524                        });
    506525
  • trunk/src/wp-includes/css/editor.css

    r27791 r27806  
    12331233                top: 235px;
    12341234        }
    1235        
     1235
    12361236        #link-selector {
    12371237                padding: 0 16px 60px;
    12381238        }
    1239        
     1239
    12401240        #wp-link-wrap.search-panel-visible #link-selector {
    12411241                bottom: 52px;
    … …  
    17241724}
    17251725
     1726/* DFW on touch screen devices */
     1727.wp-dfw-touch #fullscreen-topbar {
     1728        position: absolute;
     1729        opacity: 1;
     1730}
     1731
     1732.wp-dfw-touch .wp-fullscreen-wrap .wp-editor-container,
     1733.wp-dfw-touch .wp-fullscreen-title {
     1734        max-width: 700px;
     1735}
     1736
     1737.wp-fullscreen-active.wp-dfw-touch  .wp-fullscreen-title,
     1738.wp-fullscreen-active.wp-dfw-touch .wp-editor-container {
     1739        border-color: #ccc;
     1740}
     1741
     1742.wp-dfw-touch #wp-fullscreen-status {
     1743        opacity: 1;
     1744}
     1745
     1746@media screen and ( max-width: 782px ) {
     1747        #wp-fullscreen-close,
     1748        #wp-fullscreen-central-toolbar,
     1749        #wp-fullscreen-mode-bar,
     1750        #wp-fullscreen-button-bar,
     1751        #wp-fullscreen-save {
     1752                float: none;
     1753                display: inline-block;
     1754        }
     1755
     1756        #fullscreen-topbar {
     1757                height: 85px;
     1758        }
     1759
     1760        #wp-fullscreen-central-toolbar {
     1761                width: auto !important;
     1762        }
     1763
     1764        #wp-fullscreen-close {
     1765                line-height: 30px;
     1766                vertical-align: top;
     1767                padding: 0 12px;
     1768        }
     1769
     1770        #wp-fullscreen-button-bar {
     1771                position: absolute;
     1772                top: 45px;
     1773                left: 0;
     1774        }
     1775
     1776        .wp-fullscreen-wrap {
     1777                top: 95px;
     1778        }
     1779
     1780        .wp-fullscreen-wrap .wp-editor-container,
     1781        .wp-fullscreen-title {
     1782                max-width: 700px;
     1783        }
     1784
     1785        .wp-fullscreen-saved-message {
     1786                display: none !important;
     1787        }
     1788}
     1789
    17261790/* =Localization
    17271791-------------------------------------------------------------- */
  • trunk/src/wp-includes/version.php

    r27758 r27806  
    55 * @global string $wp_version
    66 */
    7 $wp_version = '3.9-beta2-27714-src';
     7$wp_version = '3.9-beta2-27806-src';
    88
    99/**
Note: See TracChangeset for help on using the changeset viewer.