Changeset 38156
- Timestamp:
- 07/26/2016 09:50:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
r36983 r38156 80 80 } ); 81 81 82 function isNonEditable( node ) { 83 var parent = editor.$( node ).parents( '[contenteditable]' ); 84 return parent && parent.attr( 'contenteditable' ) === 'false'; 85 } 86 82 87 // Safari on iOS fails to select images in contentEditoble mode on touch. 83 88 // Select them again. … … 85 90 editor.on( 'init', function() { 86 91 editor.on( 'touchstart', function( event ) { 87 if ( event.target.nodeName === 'IMG' ) {92 if ( event.target.nodeName === 'IMG' && ! isNonEditable( event.target ) ) { 88 93 touchOnImage = true; 89 94 } 90 95 }); 91 96 92 editor.dom.bind( editor.getDoc(), 'touchmove', function( event ) { 93 if ( event.target.nodeName === 'IMG' ) { 94 touchOnImage = false; 95 } 97 editor.dom.bind( editor.getDoc(), 'touchmove', function() { 98 touchOnImage = false; 96 99 }); 97 100 98 101 editor.on( 'touchend', function( event ) { 99 if ( touchOnImage && event.target.nodeName === 'IMG' ) {102 if ( touchOnImage && event.target.nodeName === 'IMG' && ! isNonEditable( event.target ) ) { 100 103 var node = event.target; 101 104 … … 105 108 editor.selection.select( node ); 106 109 editor.nodeChanged(); 107 }, 200 );110 }, 100 ); 108 111 } else if ( toolbar ) { 109 112 toolbar.hide();
Note: See TracChangeset
for help on using the changeset viewer.