Make WordPress Core

Changeset 22045


Ignore:
Timestamp:
09/27/2012 06:39:12 AM (12 years ago)
Author:
koopersmith
Message:

Media JS: Give the master Workspace view control over which Attachment view it uses. see #21390, #21807, #21809.

File:
1 edited

Legend:

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

    r22044 r22045  
    375375        template:  media.template('media-workspace'),
    376376
     377        // The single `Attachment` view to be used in the `Attachments` view.
     378        AttachmentView: media.view.Attachment,
     379
    377380        events: {
    378381            'dragenter':  'maybeInitUploader',
     
    393396                controller: this.controller,
    394397                directions: this.controller.get('multiple') ? l10n.selectMediaMultiple : l10n.selectMediaSingular,
    395                 collection: this.collection
     398                collection: this.collection,
     399
     400                AttachmentView: this.AttachmentView
    396401            });
    397402
     
    452457     */
    453458    media.view.Workspace.Library = media.view.Workspace.extend({
     459        // The single `Attachment` view to be used in the `Attachments` view.
     460        // AttachmentView: media.view.Attachment.Library,
     461
    454462        initialize: function() {
    455463            media.view.Workspace.prototype.initialize.apply( this, arguments );
     
    522530     */
    523531    media.view.Workspace.Gallery = media.view.Workspace.extend({
     532        // The single `Attachment` view to be used in the `Attachments` view.
     533        // AttachmentView: media.view.Attachment.Gallery,
     534
    524535        initialize: function() {
    525536            media.view.Workspace.prototype.initialize.apply( this, arguments );
     
    582593            _.defaults( this.options, {
    583594                refreshSensitivity: 200,
    584                 refreshThreshold:   3
     595                refreshThreshold:   3,
     596                AttachmentView:     media.view.Attachment
    585597            });
    586598
     
    620632            // the list in a single DOM operation.
    621633            this.$list.html( this.collection.map( function( attachment ) {
    622                 return new media.view.Attachment({
     634                return new this.options.AttachmentView({
    623635                    controller: this.controller,
    624636                    model:      attachment
Note: See TracChangeset for help on using the changeset viewer.