Ticket #27423: 27423.7.patch
File 27423.7.patch, 11.7 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-sidebar, 2330 .media-frame-router { 2314 2331 display: none; 2315 2332 } 2316 2333 2317 2334 .media-frame-menu { 2318 width: auto; 2319 bottom: auto; 2320 right: 0; 2321 height: 60px; 2335 top: 30px; 2336 left: 0; 2337 z-index: inherit; 2322 2338 } 2323 2339 2340 .media-frame .media-frame-menu-toggle { 2341 display: block; 2342 font-size: 22px; 2343 font-weight: 600; 2344 color: #444; 2345 transition: color .1s ease-in; 2346 } 2347 2348 .media-frame .media-frame-menu-toggle:after { 2349 display: inline-block; 2350 width: 20px; 2351 height: 20px; 2352 font: normal 20px/1 dashicons; 2353 content: "\f140"; 2354 -webkit-font-smoothing: antialiased; 2355 -moz-osx-font-smoothing: grayscale; 2356 } 2357 2358 .media-frame .media-frame-menu-toggle:hover, 2359 .media-frame .media-frame-menu-toggle:focus { 2360 color: #21759b; 2361 } 2362 2324 2363 .media-menu { 2325 border-right: none; 2364 z-index: inherit; 2365 width: 200px; 2326 2366 position: relative; 2327 border-bottom: 1px solid #dddddd;2328 overflow: hidden;2329 2367 padding: 10px 0 10px 10px; 2368 display: none; 2369 border: 1px solid #ccc; 2330 2370 } 2331 2371 2332 .media-menu a { 2333 float: left; 2334 width: 42%; 2335 white-space: nowrap; 2336 text-overflow: ellipsis; 2337 overflow: hidden; 2372 .media-menu.visible { 2373 z-index: 2000; 2374 display: block; 2375 position: fixed; 2376 top: 0; 2377 bottom: 0; 2378 left: 0; 2379 right: 0; 2380 width: auto; 2381 border: none; 2382 padding: 10px 0; 2338 2383 } 2339 2384 2385 .media-menu > a { 2386 padding: 20px; 2387 width: auto !important; 2388 text-align: center; 2389 font-size: 20px; 2390 } 2391 2340 2392 .media-frame-title { 2341 2393 display: none; 2342 2394 } … … 2347 2399 font-size: 14px; 2348 2400 } 2349 2401 2402 .image-details .media-frame-menu-toggle { 2403 display: none; 2404 } 2405 2350 2406 .media-frame-toolbar { 2351 2407 position: absolute; 2352 2408 bottom: 0px; 2353 2409 left: 0; 2354 2410 right: 0; 2355 background: #FFF; 2356 border-top: 1px solid #DEDEDE; 2411 background: #fff; 2357 2412 } 2358 2413 2359 2414 .media-toolbar { … … 2364 2419 overflow: hidden; 2365 2420 } 2366 2421 2367 . attachments-browser .attachments{2368 top: 42px;2422 .media-frame .attachments-browser { 2423 overflow: auto; 2369 2424 } 2370 2425 2371 .attachment-details h3 { 2372 margin-top: 45px; 2426 .attachments-browser .attachments { 2427 top: 50px; 2428 right: 0; 2373 2429 } 2374 2430 2375 2431 /* Shorten right-side links so they don't overlap the close button */ … … 2382 2438 display: none; 2383 2439 } 2384 2440 2385 . media-frame-title {2441 .image-details .media-frame-title { 2386 2442 top: 72px; 2387 left: auto;2388 height: auto;2389 2443 } 2390 2444 2391 2445 .media-frame-title h1 { … … 2394 2448 } 2395 2449 2396 2450 .media-frame-router { 2397 top: 84px;2398 2451 left: 0; 2399 2452 } 2400 2453 2401 2454 .media-frame-content { 2402 2455 left: 0; 2403 top: 118px;2456 top: 48px; 2404 2457 } 2405 2458 2406 2459 .image-details .media-frame.hide-router .media-frame-content { … … 2407 2460 top: 40px; 2408 2461 } 2409 2462 2410 .media-frame .attachments-browser { 2411 padding-bottom: 300px; 2463 .media-sidebar { 2464 position: fixed; 2465 top: 0; 2466 right: -100%; 2467 width: 100%; 2468 padding: 0; 2469 margin: 0 0 62px 0; 2470 z-index: 201; 2471 transition: .18s right ease-in-out; 2412 2472 } 2413 2473 2414 .media-sidebar {2415 border-bottom: 1px solid #dddddd;2474 .media-sidebar.active { 2475 right: 0; 2416 2476 } 2417 2477 2418 2478 .media-modal { … … 2419 2479 width: auto; 2420 2480 } 2421 2481 2422 .media-toolbar-primary, .media-toolbar-secondary { 2482 .media-toolbar-primary, 2483 .media-toolbar-secondary { 2423 2484 height: auto; 2424 2485 } 2425 2486 … … 2435 2496 margin: 0; 2436 2497 } 2437 2498 2438 .attachments-browser .attachments, .attachments-browser .uploader-inline { 2499 .attachments-browser .attachments, 2500 .attachments-browser .uploader-inline { 2439 2501 position: relative; 2440 margin-right: 180px;2502 margin-right: 0; 2441 2503 } 2442 2504 2443 2505 /* Full-bleed modal */ … … 2565 2627 2566 2628 .media-frame .spinner { 2567 2629 background-image: url(../images/spinner-2x.gif); 2568 2630 } 2569 2631 } 2570 2632 2633 /**/ 2571 2634 2635 .attachments-browser .attachment { 2636 position: relative; 2637 width: 20%; 2638 margin: 0; 2639 } 2640 2641 .attachments-browser .attachment:before { 2642 content: ''; 2643 display: block; 2644 padding-top: 100%; 2645 } 2646 2647 .attachments-browser .attachment .attachment-preview { 2648 position: absolute; 2649 top: 8px; 2650 right: 8px; 2651 bottom: 8px; 2652 left: 8px; 2653 } 2654 2655 .attachments-browser .portrait img { 2656 max-width: 100%; 2657 } 2658 2659 .attachments-browser .landscape img { 2660 max-height: 100%; 2661 } 2662 2663 /**/ 2664 2665 .media-selection .attachments { 2666 padding: 5px; 2667 } 2668 2669 .media-selection .attachment { 2670 margin: 5px; 2671 width: 40px; 2672 } 2673 2674 .media-selection .attachment-preview, 2675 .media-selection .attachment-preview .thumbnail { 2676 width: 40px; 2677 height: 40px; 2678 } 2679 2680 .media-selection .portrait .thumbnail img { 2681 max-width: 40px; 2682 height: auto; 2683 } 2684 2685 .media-selection .landscape .thumbnail img { 2686 width: auto; 2687 max-height: 40px; 2688 } 2689 2690 @media only screen and ( max-width: 400px ) { 2691 .attachments-browser .attachment { 2692 width: 50%; 2693 } 2694 } 2695 2696 @media only screen and ( min-width: 400px ) { 2697 .attachments-browser .attachment { 2698 width: 33.3%; 2699 } 2700 } 2701 2702 @media only screen and ( min-width: 520px ) { 2703 .attachments-browser .attachment { 2704 width: 25%; 2705 } 2706 } 2707 2708 @media only screen and ( min-width: 640px ) { 2709 .attachments-browser .attachment { 2710 width: 33.3%; 2711 } 2712 } 2713 2714 @media only screen and ( min-width: 960px ) { 2715 .attachments-browser .attachment { 2716 width: 25%; 2717 } 2718 } 2719 2720 @media only screen and ( min-width: 1200px ) { 2721 .attachments-browser .attachment { 2722 width: 20%; 2723 } 2724 } 2725 2572 2726 /** 2573 2727 * Media Grid 2574 2728 */ … … 2865 3019 margin-top: 3px; 2866 3020 } 2867 3021 3022 @media only screen and (max-width: 680px) { 3023 .edit-attachment-frame .attachment-fields .setting input[type="text"], 3024 .edit-attachment-frame .attachment-fields .setting input[type="password"], 3025 .edit-attachment-frame .attachment-fields .setting input[type="number"], 3026 .edit-attachment-frame .attachment-fields .setting input[type="search"], 3027 .edit-attachment-frame .attachment-fields .setting input[type="email"], 3028 .edit-attachment-frame .attachment-fields .setting input[type="url"], 3029 .edit-attachment-frame .attachment-fields .setting textarea, 3030 .edit-attachment-frame .attachment-fields .setting .value { 3031 float: none; 3032 width: 100%; 3033 } 3034 .edit-attachment-frame .attachment-fields .setting .name { 3035 padding: 0; 3036 text-align: left; 3037 } 3038 } 3039 2868 3040 @media only screen and (max-width: 1120px) { 2869 3041 .media-grid-view .media-toolbar-primary, 2870 3042 .media-grid-view .media-toolbar-secondary { -
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>