Make WordPress Core

Ticket #29235: 29235.patch

File 29235.patch, 2.5 KB (added by azaozz, 9 years ago)
  • src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js

     
    549549        }
    550550
    551551        if ( 'ontouchend' in document ) {
    552                 editor.on( 'touchend', edit );
    553 
    554552                editor.on( 'click', function( event ) {
    555553                        var target = event.target;
    556554
     
    563561                                event.stopPropagation();
    564562                        }
    565563                });
    566         } else {
    567                 editor.on( 'mouseup', edit );
    568564        }
    569565
     566        editor.on( 'mouseup touchend', edit );
     567
    570568        editor.on( 'init', function() {
    571569                var dom = editor.dom,
    572570                        captionClass = editor.getParam( 'wpeditimage_html5_captions' ) ? 'html5-captions' : 'html4-captions';
  • src/wp-includes/js/tinymce/plugins/wpview/plugin.js

     
    1111                toRemove = false,
    1212                firstFocus = true,
    1313                _noop = function() { return false; },
    14                 isTouchDevice = ( 'ontouchend' in document ),
     14                isios = /iPad|iPod|iPhone/.test( navigator.userAgent ),
    1515                cursorInterval, lastKeyDownNode, setViewCursorTries, focus, execCommandView;
    1616
    1717        function getView( node ) {
     
    141141                dom.bind( selected, 'beforedeactivate focusin focusout', _stop );
    142142
    143143                // select the hidden div
    144                 if ( isTouchDevice ) {
     144                if ( isios ) {
    145145                        editor.selection.select( clipboard );
    146146                } else {
    147147                        editor.selection.select( clipboard, true );
     
    298298                });
    299299
    300300                editor.on( 'mousedown mouseup click touchend', function( event ) {
    301                         var view = getView( event.target ),
    302                                 type = isTouchDevice ? 'touchend' : 'mousedown';
     301                        var view = getView( event.target );
    303302
    304303                        firstFocus = false;
    305304
     
    308307                                event.stopImmediatePropagation();
    309308                                event.preventDefault();
    310309
    311                                 if ( event.type === type && ! event.metaKey && ! event.ctrlKey ) {
     310                                if ( ( event.type === 'touchend' || event.type === 'mousedown' ) && ! event.metaKey && ! event.ctrlKey ) {
    312311                                        if ( editor.dom.hasClass( event.target, 'edit' ) ) {
    313312                                                wp.mce.views.edit( view );
    314313                                                editor.focus();
     
    329328                                // Unfortunately, it also inhibits the dragging of views to a new location.
    330329                                return false;
    331330                        } else {
    332                                 if ( event.type === type ) {
     331                                if ( event.type === 'touchend' || event.type === 'mousedown' ) {
    333332                                        deselect();
    334333                                }
    335334                        }