mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-06 23:58:03 +00:00
TinyMCE gallery preview: fix errors when an image doesn't have/is smaller than thumbnail size, props gcorne, see #26959
git-svn-id: https://develop.svn.wordpress.org/trunk@27580 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -268,14 +268,25 @@ window.wp = window.wp || {};
|
||||
|
||||
getHtml: function() {
|
||||
var attrs = this.shortcode.attrs.named,
|
||||
options;
|
||||
options,
|
||||
attachments;
|
||||
|
||||
if ( ! this.attachments.length ) {
|
||||
return;
|
||||
}
|
||||
|
||||
attachments = this.attachments.toJSON();
|
||||
|
||||
_.each( attachments, function( attachment ) {
|
||||
if ( attachment.sizes.thumbnail ) {
|
||||
attachment.thumbnail = attachment.sizes.thumbnail;
|
||||
} else {
|
||||
attachment.thumbnail = attachment.sizes.full;
|
||||
}
|
||||
} );
|
||||
|
||||
options = {
|
||||
attachments: this.attachments.toJSON(),
|
||||
attachments: attachments,
|
||||
columns: attrs.columns ? parseInt( attrs.columns, 10 ) : 3
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user