Ticket #28272: 28272.patch
File 28272.patch, 1.4 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
1036 1036 } 1037 1037 }); 1038 1038 1039 dom.bind( editor.getDoc(), 'dragstart', function( event ) {1040 var node = editor.selection.getNode();1041 1042 // Prevent dragging images out of the caption elements1043 if ( node.nodeName === 'IMG' && dom.getParent( node, '.wp-caption' ) ) {1044 event.preventDefault();1045 }1046 });1047 1048 1039 // Prevent IE11 from making dl.wp-caption resizable 1049 1040 if ( tinymce.Env.ie && tinymce.Env.ie > 10 ) { 1050 1041 // The 'mscontrolselect' event is supported only in IE11+ … … 1218 1209 } 1219 1210 }); 1220 1211 1212 function selectImageWrap() { 1213 var node = editor.selection.getNode(); 1214 1215 if ( node.nodeName === 'IMG' && node.parentNode.nodeName === 'A' ) { 1216 editor.selection.select( node.parentNode ); 1217 } else if ( node = editor.dom.getParent( node, '.mceTemp' ) ) { 1218 editor.selection.select( node ); 1219 } 1220 } 1221 1222 editor.on( 'dragstart', selectImageWrap ); 1223 editor.on( 'contextmenu', selectImageWrap ); 1224 editor.on( 'keydown', function( event ) { 1225 if ( tinymce.util.VK.metaKeyPressed( event ) ) { 1226 selectImageWrap(); 1227 } 1228 } ); 1229 1221 1230 return { 1222 1231 _do_shcode: parseShortcode, 1223 1232 _get_shcode: getShortcode