Changeset 28614
- Timestamp:
- 05/29/2014 07:50:35 AM (11 years ago)
- Location:
- trunk/src/wp-includes/js/tinymce
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
r28190 r28614 436 436 rectangle = dom.getRect( node ); 437 437 438 toolbarHtml = '< div class="dashicons dashicons-edit edit" data-mce-bogus="1"></div>' +439 '< div class="dashicons dashicons-no-alt remove" data-mce-bogus="1"></div>';440 441 toolbar = dom.create( ' div', {438 toolbarHtml = '<i class="dashicons dashicons-edit edit" data-mce-bogus="1"></i>' + 439 '<i class="dashicons dashicons-no-alt remove" data-mce-bogus="1"></i>'; 440 441 toolbar = dom.create( 'p', { 442 442 'id': 'wp-image-toolbar', 443 443 'data-mce-bogus': '1', … … 754 754 755 755 editor.on( 'ObjectResized', function( event ) { 756 var parent, width, 757 node = event.target, 758 dom = editor.dom; 756 var node = event.target; 759 757 760 758 if ( node.nodeName === 'IMG' ) { 761 node.className = node.className.replace( /\bsize-[^ ]+/, '' ); 762 763 if ( parent = dom.getParent( node, '.wp-caption' ) ) { 764 width = event.width || dom.getAttrib( node, 'width' ); 765 766 if ( width ) { 767 width = parseInt( width, 10 ); 768 769 if ( ! editor.getParam( 'wpeditimage_html5_captions' ) ) { 770 width += 10; 759 editor.undoManager.transact( function() { 760 var parent, width, 761 dom = editor.dom; 762 763 node.className = node.className.replace( /\bsize-[^ ]+/, '' ); 764 765 if ( parent = dom.getParent( node, '.wp-caption' ) ) { 766 width = event.width || dom.getAttrib( node, 'width' ); 767 768 if ( width ) { 769 width = parseInt( width, 10 ); 770 771 if ( ! editor.getParam( 'wpeditimage_html5_captions' ) ) { 772 width += 10; 773 } 774 775 dom.setStyle( parent, 'width', width + 'px' ); 771 776 } 772 773 dom.setStyle( parent, 'width', width + 'px' ); 774 } 775 } 776 // refresh toolbar 777 addToolbar( node ); 777 } 778 // refresh toolbar 779 addToolbar( node ); 780 }); 778 781 } 779 782 }); … … 922 925 } 923 926 924 if ( node.nodeName === ' DIV' && dom.getParent( node, '#wp-image-toolbar' ) ) {927 if ( node.nodeName === 'I' && dom.getParent( node, '#wp-image-toolbar' ) ) { 925 928 image = dom.select( 'img[data-wp-imgselect]' )[0]; 926 929 … … 941 944 }); 942 945 946 // Remove toolbar from undo levels 947 editor.on( 'BeforeAddUndo', function( event ) { 948 event.level.content = event.level.content.replace( /<p [^>]*data-mce-bogus[^>]+>[\s\S]*<\/p>/g, '' ); 949 }); 950 943 951 editor.on( 'cut', function() { 944 952 removeToolbar(); … … 954 962 955 963 editor.on( 'BeforeSetContent', function( event ) { 956 event.content = editor.wpSetImgCaption( event.content ); 964 if ( event.format !== 'raw' ) { 965 event.content = editor.wpSetImgCaption( event.content ); 966 } 957 967 }); 958 968 -
trunk/src/wp-includes/js/tinymce/skins/wordpress/wp-content.css
r28565 r28614 262 262 263 263 .wpview-wrap .toolbar div, 264 #wp-image-toolbar div{264 #wp-image-toolbar i { 265 265 margin-top: 7px; 266 266 margin-left: 7px; … … 278 278 .ie8 .wpview-wrap .toolbar div, 279 279 .ie7 .wpview-wrap .toolbar div, 280 .ie8 #wp-image-toolbar div,281 .ie7 #wp-image-toolbar div{280 .ie8 #wp-image-toolbar i, 281 .ie7 #wp-image-toolbar i { 282 282 display: inline; 283 283 padding: 0; … … 320 320 321 321 .wpview-wrap .toolbar div:hover, 322 #wp-image-toolbar div:hover {322 #wp-image-toolbar i:hover { 323 323 box-shadow: 0 1px 3px rgba(0,0,0,0.8); 324 324 background-color: #000; … … 472 472 473 473 .rtl .wpview-wrap .toolbar div, 474 .rtl #wp-image-toolbar div{474 .rtl #wp-image-toolbar i { 475 475 margin-left: auto; 476 476 margin-right: 7px;
Note: See TracChangeset
for help on using the changeset viewer.