From c4622fdbf7cd34bada5cd99338bdbec2e6516f01 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 16 Nov 2012 00:34:07 +0000 Subject: [PATCH] Editor: disable the textarea resizing handle on touch devices (cannot be used there), don't save TinyMCE's height in iOS as the user cannot set/change it there (it expands the iframe to full height), see #21718 git-svn-id: https://develop.svn.wordpress.org/trunk@22606 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/post.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 2afd7ec4d2..2edab195dc 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -619,6 +619,9 @@ jQuery(document).ready( function($) { // resizable textarea#content (function() { var textarea = $('textarea#content'), offset = null, el; + // No point for touch devices + if ( 'ontouchstart' in window ) + return; function dragging(e) { textarea.height( Math.max(50, offset + e.pageY) + 'px' ); @@ -650,7 +653,8 @@ jQuery(document).ready( function($) { if ( typeof(tinymce) != 'undefined' ) { tinymce.onAddEditor.add(function(mce, ed){ - if ( ed.id != 'content' ) + // iOS expands the iframe to full height and the user cannot adjust it. + if ( ed.id != 'content' || tinymce.isIOS5 ) return; // resize TinyMCE to match the textarea height when switching Text -> Visual