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

Gallery Widget #120

Merged
merged 43 commits into from Sep 19, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+15 −6
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Ensure r41248 from core is applied to defaultSync logic

  • Loading branch information...
westonruter committed Sep 16, 2017
commit 70480f5e5c21499caf54a919032bcc7cef587aa4
@@ -265,10 +265,14 @@
} );
} );
// Disable syncing of attachment changes back to server. See <https://core.trac.wordpress.org/ticket/40403>.
// 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 rejectedSync() {
return $.Deferred().rejectWith( this ).promise();
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;
@@ -332,10 +336,15 @@
} );
} );
// Disable syncing of attachment changes back to server. See <https://core.trac.wordpress.org/ticket/40403>.
// @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 rejectedSync() {
return $.Deferred().rejectWith( this ).promise();
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;
ProTip! Use n and p to navigate between commits in a pull request.