Ticket #27423: 27423.2.patch
File 27423.2.patch, 5.4 KB (added by , 11 years ago) |
---|
-
src/wp-includes/js/media-views.js
1747 1747 template: media.template('media-frame'), 1748 1748 regions: ['menu','title','content','toolbar','router'], 1749 1749 1750 events: { 1751 'click a.media-frame-menu-toggle': 'toggleMenu' 1752 }, 1753 1750 1754 /** 1751 1755 * @global wp.Uploader 1752 1756 */ … … 1840 1844 controller: this 1841 1845 }); 1842 1846 }, 1847 1848 toggleMenu: function( event ) { 1849 console.log( 'clicked' ); 1850 event.preventDefault(); 1851 this.$el.find( '.media-menu' ).toggleClass( 'visible' ); 1852 1853 }, 1843 1854 /** 1844 1855 * @param {Object} toolbar 1845 1856 * @this wp.media.controller.Region … … 4429 4440 }); 4430 4441 4431 4442 /** 4432 4433 4434 4435 4436 4437 4438 4439 4443 * wp.media.view.Menu 4444 * 4445 * @constructor 4446 * @augments wp.media.view.PriorityList 4447 * @augments wp.media.View 4448 * @augments wp.Backbone.View 4449 * @augments Backbone.View 4450 */ 4440 4451 media.view.Menu = media.view.PriorityList.extend({ 4441 4452 tagName: 'div', 4442 4453 className: 'media-menu', 4443 4454 property: 'state', 4444 4455 ItemView: media.view.MenuItem, 4445 4456 region: 'menu', 4457 4458 initialize: function( options ) { 4459 media.view.PriorityList.prototype.initialize.apply( this, arguments ); 4460 this.controller = options.controller; 4461 this.listenTo( this.controller, 'deactivate', function() { 4462 this.$el.removeClass( 'visible' ); 4463 } ); 4464 }, 4465 4446 4466 /** 4447 4467 * @param {Object} options 4448 4468 * @param {string} id … … 4606 4626 tagName: 'li', 4607 4627 className: 'attachment', 4608 4628 template: media.template('attachment'), 4629 isTouch: false, 4609 4630 4610 4631 attributes: { 4611 4632 tabIndex: 0, … … 4614 4635 4615 4636 events: { 4616 4637 'click .js--select-attachment': 'toggleSelectionHandler', 4638 'touchend .attachment-preview': 'setTouch', 4617 4639 'change [data-setting]': 'updateSetting', 4618 4640 'change [data-setting] input': 'updateSetting', 4619 4641 'change [data-setting] select': 'updateSetting', … … 4730 4752 this.$bar.width( this.model.get('percent') + '%' ); 4731 4753 } 4732 4754 }, 4755 4756 setTouch: function() { 4757 this.isTouch = true; 4758 }, 4759 4733 4760 /** 4734 4761 * @param {Object} event 4735 4762 */ … … 4752 4779 method = 'toggle'; 4753 4780 } 4754 4781 4782 if ( this.isTouch ) { 4783 this.isTouch = false; 4784 method = 'add'; 4785 } 4786 4755 4787 this.toggleSelection({ 4756 4788 method: method 4757 4789 }); … … 4800 4832 selection[ this.selected() ? 'remove' : 'add' ]( model ); 4801 4833 selection.single( model ); 4802 4834 return; 4835 } else if ( 'add' === method ) { 4836 selection.add( model ); 4837 selection.single( model ); 4838 return; 4839 4803 4840 } 4804 4841 4805 4842 // Fixes bug that loses focus when selecting a featured image -
src/wp-includes/media-template.php
130 130 </style> 131 131 <![endif]--> 132 132 <script type="text/html" id="tmpl-media-frame"> 133 <a class="media-frame-menu-toggle" href="#">Insert Media<!-- Change this dynamically. --><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> -
src/wp-includes/css/media-views.css
529 529 z-index: 150; 530 530 } 531 531 532 .media-frame .media-frame-menu-toggle { 533 position: absolute; 534 top: 0; 535 left: 0; 536 z-index: 200; 537 display: none; 538 text-decoration: none; 539 font-size: 16px; 540 padding: 16px; 541 } 542 543 .media-frame .media-frame-menu-toggle:hover { 544 position: absolute; 545 } 546 532 547 .media-frame-title { 533 548 position: absolute; 534 549 top: 0; … … 2315 2330 } 2316 2331 2317 2332 .media-frame-menu { 2318 width: auto; 2319 bottom: auto; 2320 right: 0; 2321 height: 60px; 2333 top: 30px; 2334 left: 0; 2335 z-index: inherit; 2322 2336 } 2323 2337 2338 .media-frame .media-frame-menu-toggle { 2339 display: block; 2340 } 2341 2324 2342 .media-menu { 2325 border-right: none; 2343 z-index: inherit; 2344 width: 200px; 2326 2345 position: relative; 2327 border-bottom: 1px solid #dddddd;2328 overflow: hidden;2329 2346 padding: 10px 0 10px 10px; 2347 display: none; 2348 border: 1px solid #ccc; 2330 2349 } 2331 2350 2332 .media-menu a { 2333 float: left; 2334 width: 42%; 2335 white-space: nowrap; 2336 text-overflow: ellipsis; 2337 overflow: hidden; 2351 .media-menu.visible { 2352 z-index: 2000; 2353 display: block; 2354 position: fixed; 2355 top: 0; 2356 bottom: 0; 2357 left: 0; 2358 right: 0; 2359 width: auto; 2360 border: none; 2361 padding: 10px 0; 2338 2362 } 2363 2364 .media-menu > a { 2365 padding: 20px; 2366 width: auto !important; 2367 text-align: center; 2368 font-size: 20px; 2369 } 2339 2370 2340 2371 .media-frame-title { 2341 2372 display: none; … … 2347 2378 font-size: 14px; 2348 2379 } 2349 2380 2381 .image-details .media-frame-menu-toggle { 2382 display: none; 2383 } 2384 2350 2385 .media-frame-toolbar { 2351 2386 position: absolute; 2352 2387 bottom: 0px; … … 2382 2417 display: none; 2383 2418 } 2384 2419 2385 . media-frame-title {2420 .image-details .media-frame-title { 2386 2421 top: 72px; 2387 left: auto;2388 height: auto;2389 2422 } 2390 2423 2391 2424 .media-frame-title h1 { … … 2394 2427 } 2395 2428 2396 2429 .media-frame-router { 2397 top: 84px;2398 2430 left: 0; 2399 2431 } 2400 2432 2401 2433 .media-frame-content { 2402 2434 left: 0; 2403 top: 118px;2404 2435 } 2405 2436 2406 2437 .image-details .media-frame.hide-router .media-frame-content {