mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 23:41:38 +01:00
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 = new Image();
|
||||||
|
|
||||||
image.onload = function() {
|
image.onload = function() {
|
||||||
if ( state === frame.state() && url === state.get('url') )
|
if ( state !== frame.state() || url !== state.get('url') )
|
||||||
state.set( 'type', 'image' );
|
return;
|
||||||
|
|
||||||
|
state.set({
|
||||||
|
type: 'image',
|
||||||
|
width: image.width,
|
||||||
|
height: image.height
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
image.src = url;
|
image.src = url;
|
||||||
|
Loading…
Reference in New Issue
Block a user