Ticket #19816: 19816.diff
| File 19816.diff, 4.2 KB (added by helenyhou, 16 months ago) |
|---|
-
wp-admin/js/theme-preview.dev.js
54 54 return false; 55 55 } ); 56 56 57 57 58 // Theme details 59 60 var currentTheme, nextLower; 61 58 62 $('#availablethemes').on('click', 'a.theme-detail', function (event) { 59 $(this).siblings('.themedetaildiv').toggle(); 63 64 if ( currentTheme !== undefined ) { 65 // remove active class/extended details div 66 $('.extended-details').remove(); 67 currentTheme.removeClass( 'active' ); 68 69 // bail if the link clicked was the same as previously 70 if ( currentTheme[0] === $(this).closest('div.available-theme')[0] ) { 71 currentTheme = undefined; 72 return false; 73 } 74 } 75 76 // reset nextLower - has scope to use for window resize reflow 77 nextLower = undefined; 78 79 var detailsDiv = $('<div class="extended-details"><div class="themedetaildiv"><h4>Theme Details</h4></div><div class="screenshots"></div></div>'); 80 81 // get parent div.available-theme 82 currentTheme = $(this).closest( 'div.available-theme' ); 83 84 // set active class for parent 85 currentTheme.addClass( 'active' ); 86 87 // get top position of parent 88 var currentPosition = currentTheme.position().top; 89 90 // find the next div.available-theme that has a lower position().top 91 currentTheme.nextAll('div.available-theme').each( function(index) { 92 if(currentPosition != $(this).position().top) { 93 nextLower = $(this); 94 return false; 95 } 96 }); 97 98 // insert/move the theme details div before that parent if found 99 if ( nextLower !== undefined ) { 100 nextLower.before(detailsDiv); 101 } 102 // if not found, insert before the end of the overall div 103 else { 104 $('#availablethemes').append(detailsDiv); 105 } 106 107 // set inner HTML of theme details div to the contents of $(this).siblings('.themedetaildiv') 108 var themeDetails = $(this).siblings('.themedetaildiv').html(); 109 $('.extended-details .themedetaildiv').append(themeDetails); 110 111 // plus the HTML for the extra screenshots, to be pulled from... ? 112 60 113 return false; 61 114 }); 62 115 116 // deal with window resizing and reflow, but only if there is something active 117 // $(window).resize( function() { } ); 118 63 119 }); -
wp-admin/css/wp-admin.dev.css
4441 4441 .available-theme { 4442 4442 display: inline-block; 4443 4443 margin-bottom: 10px; 4444 margin-right: 25px;4445 overflow: hidden;4444 margin-right: 10px; 4445 overflow: visible; 4446 4446 padding: 20px; 4447 4447 vertical-align: top; 4448 width: 240px; 4448 width: 300px; 4449 border-top-left-radius: 3px; 4450 border-top-right-radius: 3px; 4451 -webkit-border-top-left-radius: 3px; 4452 -webkit-border-top-right-radius: 3px; 4449 4453 } 4450 4454 4455 .js .available-theme.has-screenshots { 4456 background: transparent url(../images/stack.png) no-repeat 26px 5px; 4457 } 4458 4451 4459 .available-theme a.screenshot { 4452 width: 240px; 4453 height: 180px; 4460 width: 300px; 4461 height: 225px; 4462 margin: 0 auto; 4454 4463 display: block; 4455 4464 border-width: 1px; 4456 4465 border-style: solid; … … 4459 4468 } 4460 4469 4461 4470 .available-theme img { 4462 width: 240px;4471 width: 300px; 4463 4472 } 4464 4473 4465 4474 .available-theme h3 { 4466 4475 margin: 15px 0 5px; 4467 4476 } 4468 4477 4478 .available-theme.active { 4479 background: #f5f5f5; 4480 } 4481 4482 .extended-details { 4483 overflow: hidden; 4484 position: relative; 4485 margin-top: -10px; 4486 margin-bottom: 20px; 4487 padding: 5px 20px; 4488 padding-left: 330px; 4489 background-color: #f5f5f5; 4490 border-radius: 3px; 4491 -webkit-border-radius: 3px; 4492 } 4493 4494 #availablethemes .extended-details h4 { 4495 margin: 1em 0; 4496 } 4497 4498 .extended-details .themedetaildiv { 4499 position: relative; 4500 float: left; 4501 width: 280px; 4502 right: 310px; 4503 margin-right: -100%; 4504 margin-bottom: 20px; 4505 } 4506 4507 .extended-details .screenshots { 4508 position: relative; 4509 float: left; 4510 margin-top: 15px; 4511 width: 100%; 4512 } 4513 4514 .extended-details .screenshots img { 4515 float: left; 4516 margin-right: 20px; 4517 margin-bottom: 20px; 4518 width: 300px; 4519 height: 225px; 4520 border: 1px solid #ddd; 4521 } 4522 4469 4523 #current-theme { 4470 4524 margin: 1em 0 1.5em; 4471 4525 } … … 7386 7440 } 7387 7441 7388 7442 7389 #theme-information .available-theme, 7390 .available-theme { 7443 #theme-information .available-theme { 7391 7444 padding: 20px 15px; 7392 7445 } 7393 7446