Media: Ensure imgareaselect.js is not initialized twice for the same image. May happen when uploading an image into a post and then clicking on Edit Image.
Fixes #49262. git-svn-id: https://develop.svn.wordpress.org/trunk@47229 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b39db8c898
commit
6fd606d236
@ -642,9 +642,15 @@
|
|||||||
var t = this,
|
var t = this,
|
||||||
selW = $('#imgedit-sel-width-' + postid),
|
selW = $('#imgedit-sel-width-' + postid),
|
||||||
selH = $('#imgedit-sel-height-' + postid),
|
selH = $('#imgedit-sel-height-' + postid),
|
||||||
|
$image = $( image ),
|
||||||
$img;
|
$img;
|
||||||
|
|
||||||
t.iasapi = $(image).imgAreaSelect({
|
// Already initialized?
|
||||||
|
if ( $image.data( 'imgAreaSelect' ) ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
t.iasapi = $image.imgAreaSelect({
|
||||||
parent: parent,
|
parent: parent,
|
||||||
instance: true,
|
instance: true,
|
||||||
handles: true,
|
handles: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user