Changeset 52384
- Timestamp:
- 12/17/2021 08:15:01 PM (3 years ago)
- Location:
- trunk/src/js/media/controllers
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/media/controllers/featured-image.js
r52288 r52384 107 107 updateSelection: function() { 108 108 var selection = this.get('selection'), 109 library = this.get('library'),110 109 id = wp.media.view.settings.post.featuredImageId, 111 infiniteScrolling = wp.media.view.settings.infiniteScrolling,112 110 attachment; 113 111 … … 118 116 119 117 selection.reset( attachment ? [ attachment ] : [] ); 120 121 if ( ! infiniteScrolling && library.hasMore() ) {122 library.more();123 }124 118 } 125 119 }); -
trunk/src/js/media/controllers/replace-image.js
r52288 r52384 91 91 */ 92 92 activate: function() { 93 this.updateSelection(); 93 this.frame.on( 'content:render:browse', this.updateSelection, this ); 94 94 95 Library.prototype.activate.apply( this, arguments ); 96 }, 97 98 /** 99 * @since 5.9.0 100 */ 101 deactivate: function() { 102 this.frame.off( 'content:render:browse', this.updateSelection, this ); 103 104 Library.prototype.deactivate.apply( this, arguments ); 95 105 }, 96 106 … … 100 110 updateSelection: function() { 101 111 var selection = this.get('selection'), 102 library = this.get('library'), 103 attachment = this.image.attachment, 104 infiniteScrolling = wp.media.view.settings.infiniteScrolling; 112 attachment = this.image.attachment; 105 113 106 114 selection.reset( attachment ? [ attachment ] : [] ); 107 108 if ( ! infiniteScrolling && library.getTotalAttachments() === 0 && library.hasMore() ) {109 library.more();110 }111 115 } 112 116 });
Note: See TracChangeset
for help on using the changeset viewer.