From 22e1613bdefd152971ba5f255d40bf06b6364dff Mon Sep 17 00:00:00 2001 From: Konstantin Kovshenin Date: Mon, 3 Sep 2012 21:45:28 +0400 Subject: [PATCH] Replace small-menu.js with navigation.js inspired by Twenty Twelve. Doesn't use jQuery, slightly easier to understand, uses a media query for max-width, rather than JS events making it faster to respond. --- functions.php | 2 +- header.php | 4 ++-- js/navigation.js | 32 ++++++++++++++++++++++++++++++++ js/small-menu.js | 39 --------------------------------------- style.css | 14 +++++++++++++- 5 files changed, 48 insertions(+), 43 deletions(-) create mode 100644 js/navigation.js delete mode 100644 js/small-menu.js diff --git a/functions.php b/functions.php index 5067672a..33de80c7 100644 --- a/functions.php +++ b/functions.php @@ -102,7 +102,7 @@ add_action( 'widgets_init', '_s_widgets_init' ); function _s_scripts() { wp_enqueue_style( 'style', get_stylesheet_uri() ); - wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/js/small-menu.js', array( 'jquery' ), '20120206', true ); + wp_enqueue_script( 'navigation', get_template_directory_uri() . '/js/navigation.js', null, '20120206', true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); diff --git a/header.php b/header.php index 55bd1631..ad42c83d 100644 --- a/header.php +++ b/header.php @@ -51,8 +51,8 @@

-