From 792c8c34066379d0838ffbe967fbc530de53d258 Mon Sep 17 00:00:00 2001 From: Michelle Langston Date: Thu, 23 Feb 2012 19:31:05 +0000 Subject: [PATCH 1/3] _s: Remove duplicate .entry-meta class. git-svn-id: https://wpcom-themes.svn.automattic.com/_s/@9000 d957f892-c61d-0410-b221-f235e6eecf30 --- style.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/style.css b/style.css index 188c2e8c..2388de48 100644 --- a/style.css +++ b/style.css @@ -415,9 +415,6 @@ a:active { .sticky { } -.entry-meta { - clear: both; -} .hentry { margin: 0 0 1.5em; } From fc97fbd34deb63b93ae89694dc5652da0d90357d Mon Sep 17 00:00:00 2001 From: Ian Stewart Date: Wed, 29 Feb 2012 15:43:18 +0000 Subject: [PATCH 2/3] Merge branch 'master' of github.com:Automattic/_s git-svn-id: https://wpcom-themes.svn.automattic.com/_s/@9022 d957f892-c61d-0410-b221-f235e6eecf30 --- inc/tweaks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/tweaks.php b/inc/tweaks.php index 1900ef39..03e8de91 100644 --- a/inc/tweaks.php +++ b/inc/tweaks.php @@ -25,7 +25,7 @@ add_filter( 'wp_page_menu_args', '_s_page_menu_args' ); * @since _s 1.0 */ function _s_body_classes( $classes ) { - // Adds a class of single-author to blogs with only 1 published author + // Adds a class of group-blog to blogs with more than 1 published author if ( is_multi_author() ) { $classes[] = 'group-blog'; } From 8298c23e74048e3b0eb96825f6d53fbf04b06203 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 29 Feb 2012 18:53:02 +0000 Subject: [PATCH 3/3] _s: rework nav JS file a bit * Remove top-level browser width variable, only needed in one internal function * Add timeout so that the resize action doesn't constantly trigger, instead give it a short delay to anticipate the user finishing the window size change * Better comments * Incorporate mattwiebe fix for calling jQuery objects incorrectly, see http://core.trac.wordpress.org/ticket/20131 git-svn-id: https://wpcom-themes.svn.automattic.com/_s/@9026 d957f892-c61d-0410-b221-f235e6eecf30 --- js/small-menu.js | 52 ++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/js/small-menu.js b/js/small-menu.js index d0e5a3cb..28b34306 100644 --- a/js/small-menu.js +++ b/js/small-menu.js @@ -1,31 +1,39 @@ +/** + * Handles toggling the main navigation menu for small screens. + */ jQuery( document ).ready( function( $ ) { - var $browserWidth = $( window ).width(); - var $masthead = $( '#masthead' ); + var $masthead = $( '#masthead' ), + timeout = false; $.fn.smallMenu = function() { - $( $masthead ).find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' ); - $( $masthead ).find( '.site-navigation h1' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' ); + $masthead.find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' ); + $masthead.find( '.site-navigation h1' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' ); - $( '.menu-toggle' ).click( function () { - $( $masthead ).find( '.menu' ).toggle(); + $( '.menu-toggle' ).click( function() { + $masthead.find( '.menu' ).toggle(); $( this ).toggleClass( 'toggled-on' ); - }); - } + } ); + }; - $(window).resize(function() { - var $browserWidth = $( window ).width(); - - if ( $browserWidth < 600 ) { - $.fn.smallMenu(); - } else { - $( $masthead ).find( '.site-navigation' ).removeClass( 'main-small-navigation' ).addClass( 'main-navigation' ); - $( $masthead ).find( '.site-navigation h1' ).removeClass( 'menu-toggle' ).addClass( 'assistive-text' ); - $( $masthead ).find( '.menu' ).removeAttr( 'style' ); - } - }); - - if ( $browserWidth < 600 ) { + // Check viewport width on first load. + if ( $( window ).width() < 600 ) $.fn.smallMenu(); - } + // Check viewport width when user resizes the browser window. + $( window ).resize( function() { + var browserWidth = $( window ).width(); + + if ( false !== timeout ) + clearTimeout( timeout ); + + timeout = setTimeout( function() { + if ( browserWidth < 600 ) { + $.fn.smallMenu(); + } else { + $masthead.find( '.site-navigation' ).removeClass( 'main-small-navigation' ).addClass( 'main-navigation' ); + $masthead.find( '.site-navigation h1' ).removeClass( 'menu-toggle' ).addClass( 'assistive-text' ); + $masthead.find( '.menu' ).removeAttr( 'style' ); + } + }, 200 ); + } ); } ); \ No newline at end of file