diff --git a/src/wp-includes/css/media-views.css b/src/wp-includes/css/media-views.css
index 0a2ced6..3cc7020 100644
a
|
b
|
|
1016 | 1016 | top: 0; |
1017 | 1017 | } |
1018 | 1018 | |
| 1019 | .uploader-inline .close { |
| 1020 | background-color: transparent; |
| 1021 | border: 0; |
| 1022 | cursor: pointer; |
| 1023 | height: 48px; |
| 1024 | position: absolute; |
| 1025 | right: 20px; |
| 1026 | text-align: center; |
| 1027 | top: 20px; |
| 1028 | width: 50px; |
| 1029 | z-index: 1; |
| 1030 | } |
| 1031 | |
| 1032 | .uploader-inline .close:before { |
| 1033 | font: normal 30px/50px 'dashicons' !important; |
| 1034 | color: #777; |
| 1035 | display: inline-block; |
| 1036 | content: '\f335'; |
| 1037 | font-weight: 300; |
| 1038 | } |
| 1039 | |
1019 | 1040 | .inline-toolbar { |
1020 | 1041 | position: absolute; |
1021 | 1042 | top: 0; |
diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js
index 5f53808..a0ca93a 100644
a
|
b
|
|
3616 | 3616 | className: 'uploader-inline', |
3617 | 3617 | template: media.template('uploader-inline'), |
3618 | 3618 | |
| 3619 | events: { |
| 3620 | 'click .close': 'hide' |
| 3621 | }, |
| 3622 | |
3619 | 3623 | initialize: function() { |
3620 | 3624 | _.defaults( this.options, { |
3621 | 3625 | message: '', |
3622 | | status: true |
| 3626 | status: true, |
| 3627 | canClose: false |
3623 | 3628 | }); |
3624 | 3629 | |
3625 | 3630 | if ( ! this.options.$browser && this.controller.uploader ) { |
… |
… |
|
3639 | 3644 | |
3640 | 3645 | prepare: function() { |
3641 | 3646 | var suggestedWidth = this.controller.state().get('suggestedWidth'), |
3642 | | suggestedHeight = this.controller.state().get('suggestedHeight'); |
| 3647 | suggestedHeight = this.controller.state().get('suggestedHeight'), |
| 3648 | data = {}; |
| 3649 | |
| 3650 | data.canClose = this.options.canClose; |
3643 | 3651 | |
3644 | 3652 | if ( suggestedWidth && suggestedHeight ) { |
3645 | | return { |
3646 | | suggestedWidth: suggestedWidth, |
3647 | | suggestedHeight: suggestedHeight |
3648 | | }; |
| 3653 | data.suggestedWidth = suggestedWidth; |
| 3654 | data.suggestedHeight = suggestedHeight; |
3649 | 3655 | } |
| 3656 | return data; |
3650 | 3657 | }, |
3651 | 3658 | /** |
3652 | 3659 | * @returns {wp.media.view.UploaderInline} Returns itself to allow chaining |
… |
… |
|
3707 | 3714 | |
3708 | 3715 | this.refresh(); |
3709 | 3716 | return this; |
| 3717 | }, |
| 3718 | show: function() { |
| 3719 | this.$el.removeClass( 'hidden' ); |
| 3720 | }, |
| 3721 | hide: function() { |
| 3722 | this.$el.addClass( 'hidden' ); |
3710 | 3723 | } |
| 3724 | |
3711 | 3725 | }); |
3712 | 3726 | |
3713 | 3727 | /** |
… |
… |
|
5680 | 5694 | this.uploader = new media.view.UploaderInline({ |
5681 | 5695 | controller: this.controller, |
5682 | 5696 | status: false, |
5683 | | message: l10n.noItemsFound |
| 5697 | message: l10n.noItemsFound, |
| 5698 | canClose: this.controller.isModeActive( 'grid' ) |
5684 | 5699 | }); |
5685 | 5700 | |
5686 | 5701 | this.uploader.$el.addClass( 'hidden' ); |
… |
… |
|
5688 | 5703 | }, |
5689 | 5704 | |
5690 | 5705 | showUploader: function() { |
5691 | | this.uploader.$el.removeClass( 'hidden' ); |
| 5706 | this.uploader.show(); |
5692 | 5707 | }, |
5693 | 5708 | |
5694 | 5709 | createAttachments: function() { |
diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php
index 78c899e..4a85bd2 100644
a
|
b
|
function wp_print_media_templates() { |
160 | 160 | |
161 | 161 | <script type="text/html" id="tmpl-uploader-inline"> |
162 | 162 | <# var messageClass = data.message ? 'has-upload-message' : 'no-upload-message'; #> |
| 163 | <# if ( data.canClose ) { #> |
| 164 | <button class="close dashicons dashicons-no"><span class="screen-reader-text">Close overlay</span></button> |
| 165 | <# } #> |
163 | 166 | <div class="uploader-inline-content {{ messageClass }}"> |
164 | 167 | <# if ( data.message ) { #> |
165 | 168 | <h3 class="upload-message">{{ data.message }}</h3> |