diff --git src/wp-includes/css/media-views.css src/wp-includes/css/media-views.css
index c768479..cfc977f 100644
|
|
|
525 | 525 | z-index: 150; |
526 | 526 | } |
527 | 527 | |
| 528 | .media-frame .media-frame-menu-toggle { |
| 529 | position: absolute; |
| 530 | top: 0; |
| 531 | left: 0; |
| 532 | z-index: 200; |
| 533 | display: none; |
| 534 | text-transform: uppercase; |
| 535 | text-decoration: none; |
| 536 | background-color: #1E8CBE; |
| 537 | color: white; |
| 538 | font-size: 14px; |
| 539 | padding: 4px; |
| 540 | } |
| 541 | |
| 542 | .media-frame .media-frame-menu-toggle:hover { |
| 543 | position: absolute; |
| 544 | } |
| 545 | |
528 | 546 | .media-frame-title { |
529 | 547 | position: absolute; |
530 | 548 | top: 0; |
… |
… |
|
2121 | 2139 | } |
2122 | 2140 | |
2123 | 2141 | .media-frame-menu { |
2124 | | width: auto; |
2125 | | bottom: auto; |
2126 | | right: 0; |
2127 | | height: 60px; |
| 2142 | top: 30px; |
| 2143 | left: 0; |
| 2144 | z-index: inherit; |
| 2145 | } |
| 2146 | |
| 2147 | .media-frame .media-frame-menu-toggle { |
| 2148 | display: block; |
2128 | 2149 | } |
2129 | 2150 | |
2130 | 2151 | .media-menu { |
2131 | | border-right: none; |
| 2152 | z-index: inherit; |
| 2153 | width: 200px; |
2132 | 2154 | position: relative; |
2133 | | border-bottom: 1px solid #dddddd; |
2134 | | overflow: hidden; |
2135 | 2155 | padding: 10px 0 10px 10px; |
| 2156 | display: none; |
| 2157 | border: 1px solid #ccc; |
2136 | 2158 | } |
2137 | 2159 | |
2138 | | .media-menu a { |
2139 | | float: left; |
2140 | | width: 42%; |
2141 | | white-space: nowrap; |
2142 | | text-overflow: ellipsis; |
2143 | | overflow: hidden; |
| 2160 | .media-menu.visible { |
| 2161 | z-index: 2000; |
| 2162 | display: block; |
2144 | 2163 | } |
2145 | 2164 | |
2146 | 2165 | .media-frame-title { |
2147 | | display: none; |
| 2166 | top: 32px; |
| 2167 | left: 0; |
| 2168 | height: auto; |
| 2169 | width: auto; |
| 2170 | } |
| 2171 | |
| 2172 | .media-frame-title h1 { |
| 2173 | text-align: center |
2148 | 2174 | } |
2149 | 2175 | |
2150 | 2176 | .image-details .media-frame-title { |
… |
… |
|
2153 | 2179 | font-size: 14px; |
2154 | 2180 | } |
2155 | 2181 | |
| 2182 | .image-details .media-frame-menu-toggle { |
| 2183 | display: none; |
| 2184 | } |
| 2185 | |
2156 | 2186 | .media-frame-toolbar { |
2157 | 2187 | position: absolute; |
2158 | 2188 | bottom: 0px; |
… |
… |
|
2188 | 2218 | display: none; |
2189 | 2219 | } |
2190 | 2220 | |
2191 | | .media-frame-title { |
| 2221 | .image-details .media-frame-title { |
2192 | 2222 | top: 72px; |
2193 | | left: auto; |
2194 | | height: auto; |
2195 | 2223 | } |
2196 | 2224 | |
2197 | 2225 | .media-frame-title h1 { |
diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index c1407d3..4c2ced7 100644
|
|
|
1748 | 1748 | template: media.template('media-frame'), |
1749 | 1749 | regions: ['menu','title','content','toolbar','router'], |
1750 | 1750 | |
| 1751 | events: { |
| 1752 | 'click a.media-frame-menu-toggle': 'toggleMenu' |
| 1753 | }, |
| 1754 | |
1751 | 1755 | /** |
1752 | 1756 | * @global wp.Uploader |
1753 | 1757 | */ |
… |
… |
|
1833 | 1837 | controller: this |
1834 | 1838 | }); |
1835 | 1839 | }, |
| 1840 | |
| 1841 | toggleMenu: function( event ) { |
| 1842 | console.log( 'clicked' ); |
| 1843 | event.preventDefault(); |
| 1844 | this.$el.find( '.media-menu' ).toggleClass( 'visible' ); |
| 1845 | |
| 1846 | }, |
1836 | 1847 | /** |
1837 | 1848 | * @param {Object} toolbar |
1838 | 1849 | * @this wp.media.controller.Region |
… |
… |
|
4464 | 4475 | }); |
4465 | 4476 | |
4466 | 4477 | /** |
4467 | | * wp.media.view.Menu |
4468 | | * |
4469 | | * @constructor |
4470 | | * @augments wp.media.view.PriorityList |
4471 | | * @augments wp.media.View |
4472 | | * @augments wp.Backbone.View |
4473 | | * @augments Backbone.View |
4474 | | */ |
| 4478 | * wp.media.view.Menu |
| 4479 | * |
| 4480 | * @constructor |
| 4481 | * @augments wp.media.view.PriorityList |
| 4482 | * @augments wp.media.View |
| 4483 | * @augments wp.Backbone.View |
| 4484 | * @augments Backbone.View |
| 4485 | */ |
4475 | 4486 | media.view.Menu = media.view.PriorityList.extend({ |
4476 | 4487 | tagName: 'div', |
4477 | 4488 | className: 'media-menu', |
4478 | 4489 | property: 'state', |
4479 | 4490 | ItemView: media.view.MenuItem, |
4480 | 4491 | region: 'menu', |
| 4492 | |
| 4493 | initialize: function( options ) { |
| 4494 | media.view.PriorityList.prototype.initialize.apply( this, arguments ); |
| 4495 | this.controller = options.controller; |
| 4496 | this.listenTo( this.controller, 'deactivate', function() { |
| 4497 | this.$el.removeClass( 'visible' ); |
| 4498 | } ); |
| 4499 | }, |
| 4500 | |
4481 | 4501 | /** |
4482 | 4502 | * @param {Object} options |
4483 | 4503 | * @param {string} id |
… |
… |
|
4641 | 4661 | tagName: 'li', |
4642 | 4662 | className: 'attachment', |
4643 | 4663 | template: media.template('attachment'), |
| 4664 | isTouch: false, |
4644 | 4665 | |
4645 | 4666 | attributes: { |
4646 | 4667 | tabIndex: 0, |
… |
… |
|
4649 | 4670 | |
4650 | 4671 | events: { |
4651 | 4672 | 'click .attachment-preview': 'toggleSelectionHandler', |
| 4673 | 'touchend .attachment-preview': 'setTouch', |
4652 | 4674 | 'change [data-setting]': 'updateSetting', |
4653 | 4675 | 'change [data-setting] input': 'updateSetting', |
4654 | 4676 | 'change [data-setting] select': 'updateSetting', |
… |
… |
|
4763 | 4785 | this.$bar.width( this.model.get('percent') + '%' ); |
4764 | 4786 | } |
4765 | 4787 | }, |
| 4788 | |
| 4789 | setTouch: function() { |
| 4790 | this.isTouch = true; |
| 4791 | }, |
| 4792 | |
4766 | 4793 | /** |
4767 | 4794 | * @param {Object} event |
4768 | 4795 | */ |
… |
… |
|
4773 | 4800 | if ( 'keydown' === event.type && 13 !== event.keyCode && 32 !== event.keyCode ) { |
4774 | 4801 | return; |
4775 | 4802 | } |
| 4803 | |
4776 | 4804 | if ( event.shiftKey ) { |
4777 | 4805 | method = 'between'; |
4778 | 4806 | } else if ( event.ctrlKey || event.metaKey ) { |
4779 | 4807 | method = 'toggle'; |
4780 | 4808 | } |
4781 | 4809 | |
| 4810 | if ( this.isTouch ) { |
| 4811 | this.isTouch = false; |
| 4812 | method = 'add'; |
| 4813 | } |
| 4814 | |
4782 | 4815 | this.toggleSelection({ |
4783 | 4816 | method: method |
4784 | 4817 | }); |
… |
… |
|
4827 | 4860 | selection[ this.selected() ? 'remove' : 'add' ]( model ); |
4828 | 4861 | selection.single( model ); |
4829 | 4862 | return; |
| 4863 | } else if ( 'add' === method ) { |
| 4864 | selection.add( model ); |
| 4865 | selection.single( model ); |
| 4866 | return; |
| 4867 | |
4830 | 4868 | } |
4831 | 4869 | |
4832 | 4870 | // Fixes bug that loses focus when selecting a featured image |
diff --git src/wp-includes/media-template.php src/wp-includes/media-template.php
index 2c0ff80..1fe6c36 100644
|
|
function wp_print_media_templates() { |
130 | 130 | </style> |
131 | 131 | <![endif]--> |
132 | 132 | <script type="text/html" id="tmpl-media-frame"> |
| 133 | <a class="media-frame-menu-toggle" href="#"><?php _e( 'Menu' ); ?><div class="dashicons dashicons-arrow-down"></div></a> |
133 | 134 | <div class="media-frame-menu"></div> |
134 | 135 | <div class="media-frame-title"></div> |
135 | 136 | <div class="media-frame-router"></div> |