mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-23 09:12:51 +00:00
Avoid JS errors when edit image is not available, such as outside of post editing.
props gcorne. fixes #27551. git-svn-id: https://develop.svn.wordpress.org/trunk@27787 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c5717f0aa1
commit
c0fcc61290
@ -5663,8 +5663,8 @@
|
||||
* @param {Object} event
|
||||
*/
|
||||
editAttachment: function( event ) {
|
||||
var editState = this.controller.state( 'edit-image' );
|
||||
if ( window.imageEdit ) {
|
||||
var editState = this.controller.states.get( 'edit-image' );
|
||||
if ( window.imageEdit && editState ) {
|
||||
event.preventDefault();
|
||||
|
||||
editState.set( 'image', this.model );
|
||||
@ -6021,9 +6021,9 @@
|
||||
},
|
||||
|
||||
editAttachment: function( event ) {
|
||||
var editState = this.controller.state( 'edit-image' );
|
||||
var editState = this.controller.states.get( 'edit-image' );
|
||||
|
||||
if ( window.imageEdit ) {
|
||||
if ( window.imageEdit && editState ) {
|
||||
event.preventDefault();
|
||||
editState.set( 'image', this.model.attachment );
|
||||
this.controller.setState( 'edit-image' );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user