Changeset 22220
- Timestamp:
- 10/12/2012 06:36:21 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/media-upload.js
r22173 r22220 112 112 this.insert( selection.map( function( attachment ) { 113 113 if ( 'image' === attachment.get('type') ) 114 return '\n' + wp.media.string.image( attachment ) + '\n';114 return wp.media.string.image( attachment ) + ' '; 115 115 else 116 116 return wp.media.string.link( attachment ) + ' '; -
trunk/wp-includes/js/mce-view.js
r22210 r22220 282 282 toView: function( viewType, options ) { 283 283 var view = wp.mce.view.get( viewType ), 284 instance, id , tag;284 instance, id; 285 285 286 286 if ( ! view ) … … 297 297 instances[ id ] = instance; 298 298 299 // If the view is a span, wrap it in a span. 300 tag = 'span' === instance.tagName ? 'span' : 'div'; 301 302 return '<' + tag + ' class="wp-view-wrap" data-wp-view="' + id + '" contenteditable="false"></' + tag + '>'; 299 // Create a dummy `$wrapper` property to allow `$wrapper` to be 300 // called in the view's `render` method without a conditional. 301 instance.$wrapper = $(); 302 303 return wp.html.string({ 304 // If the view is a span, wrap it in a span. 305 tag: 'span' === instance.tagName ? 'span' : 'div', 306 307 attrs: { 308 'class': 'wp-view-wrap wp-view-type-' + viewType, 309 'data-wp-view': id, 310 'contenteditable': false 311 } 312 }); 303 313 }, 304 314 … … 317 327 return; 318 328 329 // Link the real wrapper to the view. 330 view.$wrapper = wrapper; 319 331 // Render the view. 320 332 view.render(); … … 544 556 return; 545 557 558 // Align the wrapper. 559 if ( this.align ) 560 this.$wrapper.addClass( 'align' + this.align ); 561 562 // Generate the template options. 546 563 options = { 547 564 url: 'image' === attachment.type ? attachment.url : attachment.icon,
Note: See TracChangeset
for help on using the changeset viewer.