Make WordPress Core

Changeset 28626


Ignore:
Timestamp:
05/30/2014 02:37:52 AM (11 years ago)
Author:
azaozz
Message:

TinyMCE in iOS:

  • Fix placing the caret at the bottom of longer posts when the keyboard is open.
  • Disable resizing on switching editors and on show/hide the kitchen sink row.

See #28242

Location:
trunk/src
Files:
3 edited

Legend:

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

    r27941 r28626  
    6161                ed.show();
    6262
    63                 if ( editorHeight ) {
     63                // No point resizing the iframe in iOS
     64                if ( ! tinymce.Env.iOS && editorHeight ) {
    6465                    toolbarHeight = getToolbarHeight();
    6566                    editorHeight = editorHeight - toolbarHeight + 14;
     
    8586
    8687            if ( ed ) {
    87                 iframe = DOM.get( id + '_ifr' );
    88                 editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
    89 
    90                 if ( editorHeight ) {
    91                     toolbarHeight = getToolbarHeight();
    92                     editorHeight = editorHeight + toolbarHeight - 14;
    93 
    94                     // height cannot be under 50 or over 5000
    95                     if ( editorHeight > 50 && editorHeight < 5000 ) {
    96                         txtarea_el.style.height = editorHeight + 'px';
     88                if ( ! tinymce.Env.iOS ) {
     89                    iframe = DOM.get( id + '_ifr' );
     90                    editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0;
     91
     92                    if ( editorHeight ) {
     93                        toolbarHeight = getToolbarHeight();
     94                        editorHeight = editorHeight + toolbarHeight - 14;
     95
     96                        // height cannot be under 50 or over 5000
     97                        if ( editorHeight > 50 && editorHeight < 5000 ) {
     98                            txtarea_el.style.height = editorHeight + 'px';
     99                        }
    97100                    }
    98101                }
  • trunk/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

    r28606 r28626  
    3838        });
    3939
    40         if ( pixels && ! initial ) {
    41             iframe = editor.getContentAreaContainer().firstChild;
    42             DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels ); // Resize iframe
     40        if (  pixels && ! initial ) {
     41            // Resize iframe, not needed in iOS
     42            if ( ! tinymce.Env.iOS ) {
     43                iframe = editor.getContentAreaContainer().firstChild;
     44                DOM.setStyle( iframe, 'height', iframe.clientHeight + pixels );
     45            }
    4346
    4447            if ( state === 'hide' ) {
     
    278281            dom = editor.dom;
    279282
     283        if ( tinymce.Env.iOS ) {
     284            dom.addClass( doc.documentElement, 'ios' );
     285        }
     286
    280287        if ( editor.getParam( 'directionality' ) === 'rtl' ) {
    281288            bodyClass.push('rtl');
     
    359366        // Don't replace <i> with <em> and <b> with <strong> and don't remove them when empty
    360367        editor.schema.addValidElements( '@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|draggable|dropzone|hidden|spellcheck|translate],i,b' );
     368
     369        if ( tinymce.Env.iOS ) {
     370            editor.settings.height = 300;
     371        }
    361372    });
    362373
  • trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css

    r28624 r28626  
    11/* Additional default styles for the editor */
     2
     3html.ios {
     4    height: 100%;
     5}
     6
     7.ios body#tinymce {
     8    height: 200%;
     9    max-width: none;
     10}
     11
    212body {
    313    font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
Note: See TracChangeset for help on using the changeset viewer.