WordPress.org

Make WordPress Core

Ticket #44790: attachment_compat_indicator.44790.1.diff

File attachment_compat_indicator.44790.1.diff, 1.3 KB (added by hjanuschka, 13 months ago)

fix spaces

  • src/js/media/views/attachment-compat.js

    diff --git src/js/media/views/attachment-compat.js src/js/media/views/attachment-compat.js
    index d995d231bf..c278f32031 100644
    AttachmentCompat = View.extend(/** @lends wp.media.view.AttachmentCompat.prototy 
    7878        },
    7979
    8080        postSave: function() {
    81                 this.controller.trigger( 'attachment:compat:ready', ['ready'] );
     81                var self = this;
     82                this.controller.trigger( 'attachment:compat:ready', ['complete'] );
     83                setTimeout( function() {
     84                        self.controller.trigger( 'attachment:compat:ready', ['ready'] );
     85                }, 2000  );
    8286        }
    8387});
    8488
  • src/js/media/views/attachment.js

    diff --git src/js/media/views/attachment.js src/js/media/views/attachment.js
    index 3c93d597b1..e8d4358b76 100644
    Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{ 
    6666                        this.details( this.model, this.controller.state().get('selection') );
    6767                }
    6868
    69                 this.listenTo( this.controller, 'attachment:compat:waiting attachment:compat:ready', this.updateSave );
     69                this.controller.on('attachment:compat:waiting', this.updateSave, this);
     70                this.controller.on('attachment:compat:ready', this.updateSave, this);
    7071        },
    7172        /**
    7273         * @returns {wp.media.view.Attachment} Returns itself to allow chaining