~canonical-sysadmins/wordpress/4.9.8

« back to all changes in this revision

Viewing changes to wp-includes/js/media-views.js

  • Committer: Barry Price
  • Date: 2018-04-10 03:27:48 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: barryprice@flollop-20180410032748-da232uugwx07f9m8
Merge WP4.9.5 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
953
953
                        }) );
954
954
                }
955
955
 
956
 
                this._filterContext();
957
 
                this.get('library').on( 'add', this._filterContext, this );
958
 
 
959
956
                this.resetDisplays();
960
957
        },
961
958
 
1155
1152
                if ( view && view.get( mode ) ) {
1156
1153
                        setUserSetting( 'libraryContent', mode );
1157
1154
                }
1158
 
        },
1159
 
 
1160
 
        /**
1161
 
         * Filter out contextually created attachments (e.g. headers, logos, etc.)
1162
 
         *
1163
 
         * @since 4.9.0
1164
 
         */
1165
 
        _filterContext: function() {
1166
 
                var library = this.get('library');
1167
 
 
1168
 
                library.set( library.filter( function( item ) {
1169
 
                        return item.get('context') === '';
1170
 
                } ) );
1171
1155
        }
 
1156
 
1172
1157
});
1173
1158
 
1174
1159
// Make selectionSync available on any Media Library state.