Changeset 31732
- Timestamp:
- 03/11/2015 10:40:56 PM (8 years ago)
- Location:
- trunk/src/wp-includes/js/tinymce/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/tinymce/plugins/wpeditimage/plugin.js
r31725 r31732 1 1 /* global tinymce */ 2 2 tinymce.PluginManager.add( 'wpeditimage', function( editor ) { 3 var floatingToolbar, serializer,3 var toolbar, serializer, 4 4 each = tinymce.each, 5 5 iOS = tinymce.Env.iOS; … … 60 60 } ); 61 61 62 editor.once( 'preinit', function() { 63 toolbar = editor.wp._createToolbar( [ 64 'wp_img_alignleft', 65 'wp_img_aligncenter', 66 'wp_img_alignright', 67 'wp_img_alignnone', 68 'wp_img_edit', 69 'wp_img_remove' 70 ] ); 71 } ); 72 62 73 editor.on( 'wptoolbar', function( event ) { 63 74 if ( event.element.nodeName === 'IMG' && ! isPlaceholder( event.element ) ) { 64 event.toolbar = floatingToolbar;75 event.toolbar = toolbar; 65 76 } 66 77 } ); … … 78 89 }, 200 ); 79 90 } else { 80 floatingToolbar.hide();91 toolbar.hide(); 81 92 } 82 93 } ); … … 545 556 dom.addClass( editor.getBody(), captionClass ); 546 557 547 if ( editor.wp._createToolbar ) {548 floatingToolbar = editor.wp._createToolbar( [549 'wp_img_alignleft',550 'wp_img_aligncenter',551 'wp_img_alignright',552 'wp_img_alignnone',553 'wp_img_edit',554 'wp_img_remove'555 ] );556 }557 558 558 // Add caption field to the default image dialog 559 559 editor.on( 'wpLoadImageForm', function( event ) { … … 868 868 event.preventDefault(); 869 869 870 if ( floatingToolbar ) {871 floatingToolbar.reposition();870 if ( toolbar ) { 871 toolbar.reposition(); 872 872 } 873 873 -
trunk/src/wp-includes/js/tinymce/plugins/wpview/plugin.js
r31725 r31732 241 241 MutationObserver = window.MutationObserver || window.WebKitMutationObserver; 242 242 243 toolbar = editor.wp._createToolbar( [244 'wp_view_edit',245 'wp_view_remove'246 ] );247 248 243 // When a view is selected, ensure content that is being pasted 249 244 // or inserted is added to a text node (instead of the view). … … 674 669 } ); 675 670 671 editor.once( 'preinit', function() { 672 toolbar = editor.wp._createToolbar( [ 673 'wp_view_edit', 674 'wp_view_remove' 675 ] ); 676 } ); 677 676 678 editor.on( 'wptoolbar', function( event ) { 677 679 if ( selected ) {
Note: See TracChangeset
for help on using the changeset viewer.