Ticket #27423: 27423.6.patch
File 27423.6.patch, 9.5 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; 2338 } 2339 2340 .media-frame .media-frame-menu-toggle { 2341 display: block; 2322 2342 } 2323 2343 2324 2344 .media-menu { 2325 border-right: none; 2345 z-index: inherit; 2346 width: 200px; 2326 2347 position: relative; 2327 border-bottom: 1px solid #dddddd;2328 overflow: hidden;2329 2348 padding: 10px 0 10px 10px; 2349 display: none; 2350 border: 1px solid #ccc; 2330 2351 } 2331 2352 2332 .media-menu a { 2333 float: left; 2334 width: 42%; 2335 white-space: nowrap; 2336 text-overflow: ellipsis; 2337 overflow: hidden; 2353 .media-menu.visible { 2354 z-index: 2000; 2355 display: block; 2356 position: fixed; 2357 top: 0; 2358 bottom: 0; 2359 left: 0; 2360 right: 0; 2361 width: auto; 2362 border: none; 2363 padding: 10px 0; 2364 } 2365 2366 .media-menu > a { 2367 padding: 20px; 2368 width: auto !important; 2369 text-align: center; 2370 font-size: 20px; 2338 2371 } 2339 2372 2340 2373 .media-frame-title { … … 2347 2380 font-size: 14px; 2348 2381 } 2349 2382 2383 .image-details .media-frame-menu-toggle { 2384 display: none; 2385 } 2386 2350 2387 .media-frame-toolbar { 2351 2388 position: absolute; 2352 2389 bottom: 0px; 2353 2390 left: 0; 2354 2391 right: 0; 2355 background: #FFF; 2356 border-top: 1px solid #DEDEDE; 2392 background: #fff; 2357 2393 } 2358 2394 2359 2395 .media-toolbar { … … 2365 2401 } 2366 2402 2367 2403 .attachments-browser .attachments { 2368 top: 42px; 2404 top: 50px; 2405 right: 0; 2369 2406 } 2370 2407 2371 2408 .attachment-details h3 { … … 2382 2419 display: none; 2383 2420 } 2384 2421 2385 . media-frame-title {2422 .image-details .media-frame-title { 2386 2423 top: 72px; 2387 left: auto;2388 height: auto;2389 2424 } 2390 2425 2391 2426 .media-frame-title h1 { … … 2393 2428 font-size: 18px; 2394 2429 } 2395 2430 2396 .media-frame-router {2397 top: 84px;2398 left: 0;2399 }2400 2401 2431 .media-frame-content { 2402 2432 left: 0; 2403 top: 118px;2433 top: 48px; 2404 2434 } 2405 2435 2406 2436 .image-details .media-frame.hide-router .media-frame-content { 2407 2437 top: 40px; 2408 2438 } 2409 2439 2410 .media-frame .attachments-browser {2411 padding-bottom: 300px;2412 }2413 2414 .media-sidebar {2415 border-bottom: 1px solid #dddddd;2416 }2417 2418 2440 .media-modal { 2419 2441 width: auto; 2420 2442 } … … 2435 2457 margin: 0; 2436 2458 } 2437 2459 2438 .attachments-browser .attachments, .attachments-browser .uploader-inline {2439 position: relative;2440 margin-right: 180px;2441 }2442 2443 2460 /* Full-bleed modal */ 2444 2461 .media-modal, 2445 2462 .image-details .media-modal { … … 2532 2549 top: 78px; 2533 2550 } 2534 2551 2535 .attachments-browser .attachments {2536 top: 2px;2537 }2538 2539 2552 /* Prevent unnecessary scrolling on title input */ 2540 2553 .embed-link-settings { 2541 2554 overflow: visible; … … 2879 2892 } 2880 2893 } 2881 2894 2895 /**/ 2896 2897 .attachments-browser .attachment { 2898 position: relative; 2899 width: 20%; 2900 margin: 0; 2901 } 2902 2903 .attachments-browser .attachment:before { 2904 content: ''; 2905 display: block; 2906 padding-top: 100%; 2907 } 2908 2909 .attachments-browser .attachment .attachment-preview { 2910 position: absolute; 2911 top: 8px; 2912 right: 8px; 2913 bottom: 8px; 2914 left: 8px; 2915 } 2916 2917 .attachments-browser .portrait img { 2918 max-width: 100%; 2919 } 2920 2921 .attachments-browser .landscape img { 2922 max-height: 100%; 2923 } 2924 2925 /**/ 2926 2927 .media-selection .attachments { 2928 padding: 5px; 2929 } 2930 2931 .media-selection .attachment { 2932 margin: 5px; 2933 width: 40px; 2934 } 2935 2936 .media-selection .attachment-preview, 2937 .media-selection .attachment-preview .thumbnail { 2938 width: 40px; 2939 height: 40px; 2940 } 2941 2942 .media-selection .portrait .thumbnail img { 2943 max-width: 40px; 2944 height: auto; 2945 } 2946 2947 .media-selection .landscape .thumbnail img { 2948 width: auto; 2949 max-height: 40px; 2950 } 2951 2952 /*@media only screen and ( max-width: 640px ) { 2953 .attachments-browser .attachment { 2954 width: 25%; 2955 } 2956 }*/ 2957 2958 @media only screen and ( max-width: 960px ) { 2959 .attachments-browser .attachment { 2960 width: 33.3%%; 2961 } 2962 } 2963 2964 @media only screen and ( min-width: 960px ) and ( max-width: 1200px ) { 2965 .attachments-browser .attachment { 2966 width: 25%; 2967 } 2968 } 2969 2970 @media only screen and ( min-width: 1200px ) { 2971 .attachments-browser .attachment { 2972 width: 20%; 2973 } 2974 } -
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. --><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>