Ticket #27055: 27055.21.diff
| File 27055.21.diff, 5.1 KB (added by , 12 years ago) |
|---|
-
wp-admin/js/theme.js
1143 1143 'click .theme-section': 'onSort', 1144 1144 'click .theme-filter': 'onFilter', 1145 1145 'click .more-filters': 'moreFilters', 1146 'click [type="checkbox"]': 'addFilter' 1146 'click .apply-filters': 'addFilter', 1147 'click [type="checkbox"]': 'filtersChecked', 1148 'click .clear-filters': 'clearFilters' 1147 1149 }, 1148 1150 1149 1151 // Handles all the rendering of the public theme directory … … 1275 1277 this.collection.query( request ); 1276 1278 }, 1277 1279 1278 // Get the checked filters and return an array 1280 // Get the checked filters 1281 // @return {array} of tags or false 1279 1282 filtersChecked: function() { 1280 1283 var items = $( '.feature-group' ).find( ':checkbox' ), 1281 1284 tags = []; … … 1284 1287 tags.push( $( item ).prop( 'value' ) ); 1285 1288 }); 1286 1289 1290 // When no filters are checked, restore initial state and return 1291 if ( tags.length === 0 ) { 1292 $( '.apply-filters' ).find( 'span' ).text( '' ); 1293 $( '.clear-filters' ).hide(); 1294 return false; 1295 } 1296 1297 $( '.apply-filters' ).find( 'span' ).text( tags.length ); 1298 $( '.clear-filters' ).css( 'display', 'inline-block' ); 1299 1287 1300 return tags; 1288 1301 }, 1289 1302 … … 1304 1317 }); 1305 1318 }, 1306 1319 1320 // Toggle the full filters navigation and 1321 // sets the handler for collapsing each individual section 1307 1322 moreFilters: function() { 1308 1323 $( 'body' ).toggleClass( 'more-filters-opened' ); 1324 1325 $( '.feature-name' ).on( 'click', function() { 1326 $( this ).parent().toggleClass( 'open' ); 1327 }); 1328 }, 1329 1330 // Clears all the checked filters 1331 // @uses filtersChecked() 1332 clearFilters: function() { 1333 var items = $( '.feature-group' ).find( ':checkbox' ), 1334 self = this; 1335 1336 _.each( items.filter( ':checked' ), function( item ) { 1337 $( item ).prop( 'checked', false ); 1338 return self.filtersChecked(); 1339 }); 1309 1340 } 1310 1341 }); 1311 1342 -
wp-admin/css/themes.css
1235 1235 -moz-box-sizing: border-box; 1236 1236 box-sizing: border-box; 1237 1237 float: left; 1238 width: 20%; 1238 width: 19%; 1239 background: #fff; 1240 margin: 0 1% 0 0; 1241 border: 1px solid #e5e5e5; 1242 -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04); 1243 box-shadow: 0 1px 1px rgba(0,0,0,0.04); 1244 padding: 10px; 1239 1245 } 1240 1246 .more-filters-container .feature-name { 1241 margin-top: 0; 1247 cursor: pointer; 1248 margin: 0; 1249 position: relative; 1242 1250 } 1251 .filters-group .feature-name:after { 1252 color: #aaa; 1253 content: '\f140'; 1254 font: normal 20px/1 'dashicons'; 1255 speak: none; 1256 display: inline-block; 1257 position: absolute; 1258 right: 0; 1259 top: -2px; 1260 -webkit-font-smoothing: antialiased; 1261 -moz-osx-font-smoothing: grayscale; 1262 text-decoration: none !important; 1263 } 1264 .filters-group:hover .feature-name:after { 1265 color: #666; 1266 } 1267 .filters-group.open .feature-name:after { 1268 content: '\f142'; 1269 } 1243 1270 .more-filters-container ol { 1244 1271 list-style-type: none; 1245 margin: 0; 1272 margin: 20px 0 0; 1273 display: none; 1274 font-size: 12px; 1246 1275 } 1276 .filters-group.open ol { 1277 display: block; 1278 } 1279 .theme-navigation .more-filters-container .apply-filters { 1280 margin: 20px 0 0; 1281 } 1282 .theme-navigation .more-filters-container .clear-filters { 1283 display: none; 1284 margin: 20px 0 0 10px; 1285 } 1286 .more-filters-container .apply-filters span { 1287 display: inline-block; 1288 font-size: 12px; 1289 text-indent: 10px; 1290 opacity: 0.8; 1291 } 1247 1292 1248 1293 .theme-install-php .add-new-theme { 1249 1294 display: none !important; … … 1268 1313 text-align: left; 1269 1314 } 1270 1315 .more-filters-container .filters-group { 1271 width: 50%; 1316 margin-bottom: 0; 1317 margin-top: 5px; 1318 width: 49%; 1272 1319 } 1273 1320 .more-filters-container .filters-group:nth-child(3n) { 1274 1321 clear: left; 1275 1322 } 1276 1323 } 1277 1324 1325 @media only screen and (max-width: 782px) { 1326 .more-filters-container .filters-group { 1327 width: 100%; 1328 } 1329 } 1330 1278 1331 .rating { 1279 1332 margin: 30px 0; 1280 1333 } -
wp-admin/theme-install.php
118 118 <a class="theme-section" href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a> 119 119 <a class="theme-section" href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a> 120 120 <div class="theme-top-filters"> 121 <!-- <span class="theme-filter" data-filter="photoblogging">Photography</span>122 <span class="theme-filter" data-filter="responsive-layout">Responsive</span> -->123 <a class="more-filters" href="#"><?php _e( ' Feature Filter' ); ?></a>121 <!-- <span class="theme-filter" data-filter="photoblogging">Photography</span> 122 <span class="theme-filter" data-filter="responsive-layout">Responsive</span> --> 123 <a class="more-filters" href="#"><?php _e( 'All' ); ?></a> 124 124 </div> 125 125 <div class="more-filters-container"> 126 126 <?php … … 140 140 } 141 141 ?> 142 142 <br class="clear" /> 143 <a class="apply-filters button button-secondary"><?php _e( 'Apply Filters' ); ?><span></span></a> 144 <a class="clear-filters button button-secondary"><?php _e( 'Clear' ); ?></a> 143 145 </div> 144 146 </div> 145 147 <div class="theme-browser"></div>