Media: Calculate image width and height when embedding images. see #21390.
git-svn-id: http://core.svn.wordpress.org/trunk@22762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e0ebe09802
commit
5cecff80b8
|
@ -557,8 +557,14 @@
|
|||
image = new Image();
|
||||
|
||||
image.onload = function() {
|
||||
if ( state === frame.state() && url === state.get('url') )
|
||||
state.set( 'type', 'image' );
|
||||
if ( state !== frame.state() || url !== state.get('url') )
|
||||
return;
|
||||
|
||||
state.set({
|
||||
type: 'image',
|
||||
width: image.width,
|
||||
height: image.height
|
||||
});
|
||||
};
|
||||
|
||||
image.src = url;
|
||||
|
|
Loading…
Reference in New Issue