WordPress.org

Make WordPress Core

Changeset 27477


Ignore:
Timestamp:
03/09/2014 01:05:48 AM (6 years ago)
Author:
wonderboymusic
Message:

In wp.media.model.PostAudio and wp.media.model.PostVideo, use Underscore's unset method when clearing out properties when the attachment changes.

See #27016.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-models.js

    r27445 r27477  
    473473                this.set( this.extension, attachment.get( 'url' ) );
    474474            } else {
    475                 this.set( this.extension, '' );
     475                this.unset( this.extension );
    476476            }
    477477
    478478            _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
    479                 self.set( ext, '' );
     479                self.unset( ext );
    480480            } );
    481481        }
     
    502502                this.set( this.extension, attachment.get( 'url' ) );
    503503            } else {
    504                 this.set( this.extension, '' );
     504                this.unset( this.extension );
    505505            }
    506506
    507507            _.each( _.without( wp.media.view.settings.embedExts, this.extension ), function (ext) {
    508                 self.set( ext, '' );
     508                self.unset( ext );
    509509            } );
    510510        }
Note: See TracChangeset for help on using the changeset viewer.