Ticket #27423: 27423.7.1.patch
File 27423.7.1.patch, 11.1 KB (added by , 11 years ago) |
---|
-
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; … … 683 698 */ 684 699 .attachments { 685 700 margin: 0; 686 padding -right: 16px;701 padding: 8px; 687 702 -webkit-overflow-scrolling: touch; 688 703 } 689 704 … … 705 720 } 706 721 707 722 .attachment:focus { 723 outline: none; 724 } 725 726 .attachment:focus .attachment-preview { 708 727 -webkit-box-shadow: 709 728 0 0 0 1px #5b9dd9, 710 729 0 0 2px 2px #5b9dd9; … … 711 730 box-shadow: 712 731 0 0 0 1px #5b9dd9, 713 732 0 0 2px 2px #5b9dd9; 714 outline: none;715 733 } 716 734 717 .selected.attachment {735 .selected.attachment .attachment-preview { 718 736 -webkit-box-shadow: 719 737 0 0 0 1px #fff, 720 738 0 0 0 3px #ccc; … … 725 743 726 744 .attachment-preview { 727 745 position: relative; 728 width: 199px;729 height: 199px;730 746 -webkit-box-shadow: 731 747 inset 0 0 15px rgba( 0, 0, 0, 0.1 ), 732 748 inset 0 0 0 1px rgba( 0, 0, 0, 0.05 ); … … 904 920 display: block; 905 921 } 906 922 907 .attachment.details ,923 .attachment.details .attachment-preview, 908 924 .media-grid-view .selected.attachment { 909 925 -webkit-box-shadow: 0 0 0 1px #fff, 910 926 0 0 0 5px #1e8cbe; … … 1456 1472 .media-selection .attachments { 1457 1473 display: inline-block; 1458 1474 height: 48px; 1459 margin-top: 5px;1460 1475 overflow: hidden; 1461 1476 vertical-align: top; 1462 1477 } … … 2310 2325 @media only screen and (max-width: 640px), screen and (max-height: 400px) { 2311 2326 2312 2327 /* Media tabs on the top */ 2313 .media-frame-content .media-toolbar .instructions { 2328 .media-frame-content .media-toolbar .instructions, 2329 .media-frame-router { 2314 2330 display: none; 2315 2331 } 2316 2332 2317 2333 .media-frame-menu { 2318 width: auto; 2319 bottom: auto; 2320 right: 0; 2321 height: 60px; 2334 top: 30px; 2335 left: 0; 2336 z-index: inherit; 2322 2337 } 2323 2338 2339 .media-frame .media-frame-menu-toggle { 2340 display: block; 2341 font-size: 22px; 2342 font-weight: 600; 2343 color: #444; 2344 transition: color .1s ease-in; 2345 } 2346 2347 .media-frame .media-frame-menu-toggle:after { 2348 display: inline-block; 2349 width: 20px; 2350 height: 20px; 2351 font: normal 20px/1 dashicons; 2352 content: "\f140"; 2353 -webkit-font-smoothing: antialiased; 2354 -moz-osx-font-smoothing: grayscale; 2355 } 2356 2357 .media-frame .media-frame-menu-toggle:hover, 2358 .media-frame .media-frame-menu-toggle:focus { 2359 color: #21759b; 2360 } 2361 2324 2362 .media-menu { 2325 border-right: none; 2363 z-index: inherit; 2364 width: 200px; 2326 2365 position: relative; 2327 border-bottom: 1px solid #dddddd;2328 overflow: hidden;2329 2366 padding: 10px 0 10px 10px; 2367 display: none; 2368 border: 1px solid #ccc; 2330 2369 } 2331 2370 2332 .media-menu a { 2333 float: left; 2334 width: 42%; 2335 white-space: nowrap; 2336 text-overflow: ellipsis; 2337 overflow: hidden; 2371 .media-menu.visible { 2372 z-index: 2000; 2373 display: block; 2374 position: fixed; 2375 top: 0; 2376 bottom: 0; 2377 left: 0; 2378 right: 0; 2379 width: auto; 2380 border: none; 2381 padding: 10px 0; 2338 2382 } 2339 2383 2384 .media-menu > a { 2385 padding: 20px; 2386 width: auto !important; 2387 text-align: center; 2388 font-size: 20px; 2389 } 2390 2340 2391 .media-frame-title { 2341 2392 display: none; 2342 2393 } … … 2347 2398 font-size: 14px; 2348 2399 } 2349 2400 2401 .image-details .media-frame-menu-toggle { 2402 display: none; 2403 } 2404 2350 2405 .media-frame-toolbar { 2351 2406 position: absolute; 2352 2407 bottom: 0px; 2353 2408 left: 0; 2354 2409 right: 0; 2355 background: #FFF; 2356 border-top: 1px solid #DEDEDE; 2410 background: #fff; 2357 2411 } 2358 2412 2359 2413 .media-toolbar { … … 2364 2418 overflow: hidden; 2365 2419 } 2366 2420 2367 . attachments-browser .attachments{2368 top: 42px;2421 .media-frame .attachments-browser { 2422 overflow: auto; 2369 2423 } 2370 2424 2371 .attachment-details h3 { 2372 margin-top: 45px; 2425 .attachments-browser .attachments { 2426 top: 0; 2427 right: 0; 2373 2428 } 2374 2429 2375 2430 /* Shorten right-side links so they don't overlap the close button */ … … 2382 2437 display: none; 2383 2438 } 2384 2439 2385 .media-frame-title { 2440 .attachment-details { 2441 padding: 0 20px; 2442 } 2443 2444 .attachment-display-settings { 2445 padding: 0 20px 20px 20px; 2446 width: -webkit-calc(100% - 40px); 2447 width: calc(100% - 40px); 2448 } 2449 2450 .attachment-info .thumbnail img { 2451 max-width: 100%; /* Display the image bigger, since the screen's smaller. */ 2452 max-height: 50%; 2453 } 2454 2455 .image-details .media-frame-title { 2386 2456 top: 72px; 2387 left: auto;2388 height: auto;2389 2457 } 2390 2458 2391 2459 .media-frame-title h1 { … … 2394 2462 } 2395 2463 2396 2464 .media-frame-router { 2397 top: 84px;2398 2465 left: 0; 2399 2466 } 2400 2467 2401 2468 .media-frame-content { 2402 2469 left: 0; 2403 top: 118px;2470 top: 48px; 2404 2471 } 2405 2472 2406 2473 .image-details .media-frame.hide-router .media-frame-content { … … 2407 2474 top: 40px; 2408 2475 } 2409 2476 2410 .media-frame .attachments-browser { 2411 padding-bottom: 300px; 2477 .media-sidebar { 2478 position: fixed; 2479 top: 0; 2480 right: -100%; 2481 width: 100%; 2482 padding: 0; 2483 margin: 0 0 62px 0; 2484 z-index: 201; 2485 transition: .18s right ease-in-out; 2412 2486 } 2413 2487 2414 .media-sidebar {2415 border-bottom: 1px solid #dddddd;2488 .media-sidebar.active { 2489 right: 0; 2416 2490 } 2417 2491 2418 2492 .media-modal { … … 2419 2493 width: auto; 2420 2494 } 2421 2495 2422 .media-toolbar-primary, .media-toolbar-secondary { 2496 .media-toolbar-primary, 2497 .media-toolbar-secondary { 2423 2498 height: auto; 2424 2499 } 2425 2500 … … 2435 2510 margin: 0; 2436 2511 } 2437 2512 2438 .attachments-browser .attachments, .attachments-browser .uploader-inline { 2513 .attachments-browser .attachments, 2514 .attachments-browser .uploader-inline { 2439 2515 position: relative; 2440 margin-right: 180px;2516 margin-right: 0; 2441 2517 } 2442 2518 2443 2519 /* Full-bleed modal */ … … 2565 2641 2566 2642 .media-frame .spinner { 2567 2643 background-image: url(../images/spinner-2x.gif); 2568 2644 } 2569 2645 } 2570 2646 2647 .attachments-browser .attachment { 2648 position: relative; 2649 width: 20%; 2650 margin: 0; 2651 } 2571 2652 2653 .attachments-browser .attachment:before { 2654 content: ''; 2655 display: block; 2656 padding-top: 100%; 2657 } 2658 2659 .attachments-browser .attachment .attachment-preview { 2660 position: absolute; 2661 top: 8px; 2662 right: 8px; 2663 bottom: 8px; 2664 left: 8px; 2665 } 2666 2667 .attachments-browser .portrait img { 2668 max-width: 100%; 2669 } 2670 2671 .attachments-browser .landscape img { 2672 max-height: 100%; 2673 } 2674 2675 /**/ 2676 2677 .media-selection .attachments { 2678 padding: 5px; 2679 } 2680 2681 .media-selection .attachment { 2682 margin: 5px; 2683 width: 40px; 2684 } 2685 2686 .media-selection .attachment-preview, 2687 .media-selection .attachment-preview .thumbnail { 2688 width: 40px; 2689 height: 40px; 2690 } 2691 2692 .media-selection .portrait .thumbnail img { 2693 max-width: 40px; 2694 height: auto; 2695 } 2696 2697 .media-selection .landscape .thumbnail img { 2698 width: auto; 2699 max-height: 40px; 2700 } 2701 2702 @media only screen and ( max-width: 400px ) { 2703 .attachments-browser .attachment { 2704 width: 50%; 2705 } 2706 } 2707 2708 @media only screen and ( min-width: 400px ) { 2709 .attachments-browser .attachment { 2710 width: 33.3%; 2711 } 2712 } 2713 2714 @media only screen and ( min-width: 520px ) { 2715 .attachments-browser .attachment { 2716 width: 25%; 2717 } 2718 } 2719 2720 @media only screen and ( min-width: 640px ) { 2721 .attachments-browser .attachment { 2722 width: 33.3%; 2723 } 2724 } 2725 2726 @media only screen and ( min-width: 960px ) { 2727 .attachments-browser .attachment { 2728 width: 25%; 2729 } 2730 } 2731 2732 @media only screen and ( min-width: 1200px ) { 2733 .attachments-browser .attachment { 2734 width: 20%; 2735 } 2736 } 2737 2572 2738 /** 2573 2739 * Media Grid 2574 2740 */ -
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 … … 5149 5186 5150 5187 this.initSortable(); 5151 5188 5152 _.bindAll( this, 'css' );5189 /*_.bindAll( this, 'css' ); 5153 5190 this.model.on( 'change:edge change:gutter', this.css, this ); 5154 5191 this._resizeCss = _.debounce( _.bind( this.css, this ), this.refreshSensitivity ); 5155 5192 if ( this.options.resize ) { … … 5158 5195 5159 5196 // Call this.css() after this view has been rendered in the DOM so 5160 5197 // attachments get proper width applied. 5161 _.defer( this.css, this ); 5198 _.defer( this.css, this );*/ 5162 5199 }, 5163 5200 5164 5201 dispose: function() { -
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. --></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>