This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Remove disabling of syncing attachment changes to server so captions …

…can be modified
  • Loading branch information...
westonruter committed Sep 16, 2017
1 parent 775f498 commit e5ee972bb985d0bf4849780556a1d433005b04c7
Showing with 2 additions and 29 deletions.
  1. +2 −29 wp-admin/js/widgets/media-gallery-widget.js
@@ -218,7 +218,7 @@
* @returns {void}
*/
editMedia: function editMedia() {
var control = this, selection, mediaFrame, defaultSync, mediaFrameProps;
var control = this, selection, mediaFrame, mediaFrameProps;
selection = new wp.media.model.Selection( control.selectedAttachments.models, {
multiple: true
});
@@ -265,19 +265,6 @@
} );
} );
// Disable syncing of attachment changes back to server (except for deletions). See <https://core.trac.wordpress.org/ticket/40403>.
defaultSync = wp.media.model.Attachment.prototype.sync;
wp.media.model.Attachment.prototype.sync = function( method ) {
if ( 'delete' === method ) {
return defaultSync.apply( this, arguments );
} else {
return $.Deferred().rejectWith( this ).promise();
}
};
mediaFrame.on( 'close', function onClose() {
wp.media.model.Attachment.prototype.sync = defaultSync;
});
mediaFrame.$el.addClass( 'media-widget' );
mediaFrame.open();
@@ -292,7 +279,7 @@
* @returns {void}
*/
selectMedia: function selectMedia() {
var control = this, selection, mediaFrame, defaultSync, mediaFrameProps;
var control = this, selection, mediaFrame, mediaFrameProps;
selection = new wp.media.model.Selection( control.selectedAttachments.models, {
multiple: true
});
@@ -336,20 +323,6 @@
} );
} );
// @todo The following needs to be updated in MediaWidgetControl#selectMedia in core, where it was missed in r41248.
// Disable syncing of attachment changes back to server (except for deletions). See <https://core.trac.wordpress.org/ticket/40403>.
defaultSync = wp.media.model.Attachment.prototype.sync;
wp.media.model.Attachment.prototype.sync = function( method ) {
if ( 'delete' === method ) {
return defaultSync.apply( this, arguments );
} else {
return $.Deferred().rejectWith( this ).promise();
}
};
mediaFrame.on( 'close', function onClose() {
wp.media.model.Attachment.prototype.sync = defaultSync;
});
mediaFrame.$el.addClass( 'media-widget' );
mediaFrame.open();

0 comments on commit e5ee972

Please sign in to comment.