Ticket #27423: 27423.5.patch
File 27423.5.patch, 8.6 KB (added by , 10 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 } … … 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; 2336 } 2337 2338 .media-frame .media-frame-menu-toggle { 2339 display: block; 2322 2340 } 2323 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; 2362 } 2363 2364 .media-menu > a { 2365 padding: 20px; 2366 width: auto !important; 2367 text-align: center; 2368 font-size: 20px; 2338 2369 } 2339 2370 2340 2371 .media-frame-title { … … 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 { … … 2879 2910 } 2880 2911 } 2881 2912 2913 /**/ 2914 2915 .attachments-browser .attachment { 2916 position: relative; 2917 width: 20%; 2918 margin: 0; 2919 } 2920 2921 .attachments-browser .attachment:before { 2922 content: ''; 2923 display: block; 2924 padding-top: 100%; 2925 } 2926 2927 .attachments-browser .attachment .attachment-preview { 2928 position: absolute; 2929 top: 8px; 2930 right: 8px; 2931 bottom: 8px; 2932 left: 8px; 2933 } 2934 2935 .attachments-browser .portrait img { 2936 max-width: 100%; 2937 } 2938 2939 .attachments-browser .landscape img { 2940 max-height: 100%; 2941 } 2942 2943 /**/ 2944 2945 .media-selection .attachments { 2946 padding: 5px; 2947 } 2948 2949 .media-selection .attachment { 2950 margin: 5px; 2951 width: 40px; 2952 } 2953 2954 .media-selection .attachment-preview, 2955 .media-selection .attachment-preview .thumbnail { 2956 width: 40px; 2957 height: 40px; 2958 } 2959 2960 .media-selection .portrait .thumbnail img { 2961 max-width: 40px; 2962 height: auto; 2963 } 2964 2965 .media-selection .landscape .thumbnail img { 2966 width: auto; 2967 max-height: 40px; 2968 } 2969 2970 /* 2 per row for small screens. But we should hide the sidebar, so we can display more. I think 3/4 would be a good number. */ 2971 @media only screen and ( max-width: 640px ) { 2972 .attachments-browser .attachment { 2973 width: 50%; 2974 } 2975 } 2976 2977 @media only screen and ( min-width: 640px ) and ( max-width: 960px ) { 2978 .attachments-browser .attachment { 2979 width: 33.3%%; 2980 } 2981 } 2982 2983 @media only screen and ( min-width: 960px ) and ( max-width: 1200px ) { 2984 .attachments-browser .attachment { 2985 width: 25%; 2986 } 2987 } 2988 2989 @media only screen and ( min-width: 1200px ) { 2990 .attachments-browser .attachment { 2991 width: 20%; 2992 } 2993 } 2994 2995 /* etc. etc. At a certain width we can stop, images will just get bigger... */ -
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>