diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 5b10a05d5f..bfece3dbd0 100644
|
|
|
Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ |
| 3878 | 3878 | style: 'primary', |
| 3879 | 3879 | text: editing ? l10n.updateGallery : l10n.insertGallery, |
| 3880 | 3880 | priority: 80, |
| 3881 | | requires: { library: true }, |
| | 3881 | requires: { library: true, uploadingComplete: true }, |
| 3882 | 3882 | |
| 3883 | 3883 | /** |
| 3884 | 3884 | * @fires wp.media.controller.State#update |
| … |
… |
Toolbar = View.extend(/** @lends wp.media.view.Toolbar.prototype */{ |
| 5288 | 5288 | } |
| 5289 | 5289 | |
| 5290 | 5290 | var requires = button.options.requires, |
| 5291 | | disabled = false; |
| | 5291 | disabled = false, |
| | 5292 | modelsUploading = ! _.isEmpty( library.findWhere( { 'uploading': true } ) ); |
| 5292 | 5293 | |
| 5293 | 5294 | // Prevent insertion of attachments if any of them are still uploading |
| 5294 | 5295 | if ( selection && selection.models ) { |
| … |
… |
Toolbar = View.extend(/** @lends wp.media.view.Toolbar.prototype */{ |
| 5297 | 5298 | }); |
| 5298 | 5299 | } |
| 5299 | 5300 | |
| | 5301 | if ( requires.uploadingComplete && modelsUploading ) { |
| | 5302 | disabled = true; |
| | 5303 | } |
| | 5304 | |
| 5300 | 5305 | if ( requires.selection && selection && ! selection.length ) { |
| 5301 | 5306 | disabled = true; |
| 5302 | 5307 | } else if ( requires.library && library && ! library.length ) { |
diff --git src/wp-includes/js/media/views/frame/post.js src/wp-includes/js/media/views/frame/post.js
index 8c8906e26b..646431502a 100644
|
|
|
Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ |
| 574 | 574 | style: 'primary', |
| 575 | 575 | text: editing ? l10n.updateGallery : l10n.insertGallery, |
| 576 | 576 | priority: 80, |
| 577 | | requires: { library: true }, |
| | 577 | requires: { library: true, uploadingComplete: true }, |
| 578 | 578 | |
| 579 | 579 | /** |
| 580 | 580 | * @fires wp.media.controller.State#update |
diff --git src/wp-includes/js/media/views/toolbar.js src/wp-includes/js/media/views/toolbar.js
index 258d12697a..eb825af8e5 100644
|
|
|
Toolbar = View.extend(/** @lends wp.media.view.Toolbar.prototype */{ |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | var requires = button.options.requires, |
| 143 | | disabled = false; |
| | 143 | disabled = false, |
| | 144 | modelsUploading = ! _.isEmpty( library.findWhere( { 'uploading': true } ) ); |
| 144 | 145 | |
| 145 | 146 | // Prevent insertion of attachments if any of them are still uploading |
| 146 | 147 | if ( selection && selection.models ) { |
| … |
… |
Toolbar = View.extend(/** @lends wp.media.view.Toolbar.prototype */{ |
| 149 | 150 | }); |
| 150 | 151 | } |
| 151 | 152 | |
| | 153 | if ( requires.uploadingComplete && modelsUploading ) { |
| | 154 | disabled = true; |
| | 155 | } |
| | 156 | |
| 152 | 157 | if ( requires.selection && selection && ! selection.length ) { |
| 153 | 158 | disabled = true; |
| 154 | 159 | } else if ( requires.library && library && ! library.length ) { |