From daf4baf3ed400f039452a54c45594ec90d45eb4c Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 3 Aug 2014 22:33:05 +0000 Subject: [PATCH] Mobile: hide the onscreen keyboard when the media modal opens, fixes #28549. git-svn-id: https://develop.svn.wordpress.org/trunk@29369 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-editor.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/wp-includes/js/media-editor.js b/src/wp-includes/js/media-editor.js index 2197abd165..f0063aaf55 100644 --- a/src/wp-includes/js/media-editor.js +++ b/src/wp-includes/js/media-editor.js @@ -1048,22 +1048,22 @@ * @returns {wp.media.view.MediaFrame} */ open: function( id, options ) { - var workflow; + var workflow, focusTrap; + + if ( 'ontouchend' in document ) { + // Close the onscreen keyboard + if ( ! focusTrap ) { + focusTrap = $( '' ); + } + + $( document.body ).append( focusTrap ); + focusTrap.focus().blur().remove(); + } options = options || {}; id = this.id( id ); -/* - // Save a bookmark of the caret position in IE. - if ( ! _.isUndefined( window.tinymce ) ) { - editor = tinymce.get( id ); - if ( tinymce.isIE && editor && ! editor.isHidden() ) { - editor.focus(); - editor.windowManager.insertimagebookmark = editor.selection.getBookmark(); - } - } -*/ workflow = this.get( id ); // Redo workflow if state has changed