Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

TinyNav updated.

  • Loading branch information...
commit 7b4621600817cc21e787f319f6120bf285f3e057 1 parent cd8bf6c
@samikeijonen authored
View
11 functions.php
@@ -195,8 +195,15 @@ function live_wire_scripts() {
wp_enqueue_script( 'live_wire-fitvids-settings', trailingslashit ( THEME_URI ) . 'js/fitvids.js', '', '20120222', true );
/* Enqueue TinyNav */
- wp_enqueue_script( 'live_wire-tinynav', trailingslashit ( THEME_URI ) . 'js/tinynav.min.js', array( 'jquery' ), '20120301', true );
- wp_enqueue_script( 'live_wire-tinynav-settings', trailingslashit ( THEME_URI ) . 'js/tinynav.js', '', '20120301', true );
+ wp_enqueue_script( 'live_wire-tinynav', trailingslashit ( THEME_URI ) . 'js/tinynav.min.js', array( 'jquery' ), '20121228', true );
+ wp_enqueue_script( 'live_wire-tinynav-settings', trailingslashit ( THEME_URI ) . 'js/tinynav.js', '', '20121228', true );
+
+ /* Localize header text in TinyNav. @link: http://pippinsplugins.com/use-wp_localize_script-it-is-awesome */
+ wp_localize_script( 'live_wire-tinynav-settings', 'tinynav_settings_vars', array(
+ 'header_primary' => __( 'Primary Navigation...', 'live-wire' ),
+ 'header_secondary' => __( 'Secondary Navigation...', 'live-wire' )
+ )
+ );
}
}
View
10 js/tinynav.js
@@ -2,12 +2,14 @@
jQuery(function(){
// Primary Menu
jQuery('#menu-primary-items').tinyNav({
- //active: 'current-menu-item', // Set the "active" class.
- //header: true // Show header instead of the active item
+ active: 'current-menu-item', // Set the "active" class
+ label: '', // String: Sets the <label> text for the <select> (if not set, no label will be added)
+ header: tinynav_settings_vars.header_primary // String: Specify text for "header" and show header instead of the active item
});
// Secondary Menu
jQuery('#menu-secondary-items').tinyNav({
- //active: 'current-menu-item', // Set the "active" class.
- //header: false // Show header instead of the active item
+ active: 'current-menu-item', // Set the "active" class
+ label: '', // String: Sets the <label> text for the <select> (if not set, no label will be added)
+ header: tinynav_settings_vars.header_secondary // String: Specify text for "header" and show header instead of the active item
});
});
View
6 js/tinynav.min.js
@@ -1,3 +1,3 @@
-/*! http://tinynav.viljamis.com v1.03 by @viljamis */
-(function(a,i,g){a.fn.tinyNav=function(j){var c=a.extend({active:"selected",header:!1},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,e=".l_"+d,b=a("<select/>").addClass("tinynav "+d);if(h.is("ul,ol")){c.header&&b.append(a("<option/>").text("Navigation"));var f="";h.addClass("l_"+d).find("a").each(function(){f+='<option value="'+a(this).attr("href")+'">'+a(this).text()+"</option>"});b.append(f);c.header||b.find(":eq("+a(e+" li").index(a(e+" li."+c.active))+")").attr("selected",!0);
-b.change(function(){i.location.href=a(this).val()});a(e).after(b)}})}})(jQuery,this,0);
+/*! http://tinynav.viljamis.com v1.1 by @viljamis */
+(function(a,i,g){a.fn.tinyNav=function(j){var b=a.extend({active:"selected",header:"",label:""},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,f=".l_"+d,e=a("<select/>").attr("id",d).addClass("tinynav "+d);if(h.is("ul,ol")){""!==b.header&&e.append(a("<option/>").text(b.header));var c="";h.addClass("l_"+d).find("a").each(function(){c+='<option value="'+a(this).attr("href")+'">';var b;for(b=0;b<a(this).parents("ul, ol").length-1;b++)c+="- ";c+=a(this).text()+"</option>"});e.append(c);
+b.header||e.find(":eq("+a(f+" li").index(a(f+" li."+b.active))+")").attr("selected",!0);e.change(function(){i.location.href=a(this).val()});a(f).after(e);b.label&&e.before(a("<label/>").attr("for",d).addClass("tinynav_label "+d+"_label").append(b.label))}})}})(jQuery,this,0);
View
2  menu-primary.php
@@ -19,7 +19,7 @@
<?php do_atomic( 'open_menu_primary' ); // live-wire_open_menu_primary ?>
- <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'menu', 'menu_class' => '', 'menu_id' => 'menu-primary-items', 'items_wrap' => '<ul id="%1$s" class="%2$s"><li class="tinynav-select-menu"><a href="#">' . __( 'Primary Navigation...', 'live-wire' ) . '</a></li>%3$s</ul>', 'fallback_cb' => '' ) ); ?>
+ <?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'menu', 'menu_class' => '', 'menu_id' => 'menu-primary-items', 'fallback_cb' => '' ) ); ?>
<?php do_atomic( 'close_menu_primary' ); // live-wire_close_menu_primary ?>
View
2  menu-secondary.php
@@ -19,7 +19,7 @@
<?php do_atomic( 'open_menu_secondary' ); // live-wire_open_menu_secondary ?>
- <?php wp_nav_menu( array( 'theme_location' => 'secondary', 'container_class' => 'menu', 'menu_class' => '', 'menu_id' => 'menu-secondary-items', 'items_wrap' => '<ul id="%1$s" class="%2$s"><li class="tinynav-select-menu"><a href="#">' . __( 'Secondary Navigation...', 'live-wire' ) . '</a></li>%3$s</ul>', 'fallback_cb' => '' ) ); ?>
+ <?php wp_nav_menu( array( 'theme_location' => 'secondary', 'container_class' => 'menu', 'menu_class' => '', 'menu_id' => 'menu-secondary-items', 'fallback_cb' => '' ) ); ?>
<?php do_atomic( 'close_menu_secondary' ); // live-wire_close_menu_secondary ?>
View
18 style.css
@@ -2,7 +2,7 @@
* Theme Name: Live Wire
* Theme URI: http://themehybrid.com/themes/live-wire
* Description: Live Wire is about rocking your blogging. It was designed with Mobile first attitude, it supports post formats, it's translation-ready and what else.
- * Version: 0.1.6
+ * Version: 0.2
* Author: Sami Keijonen
* Author URI: http://foxnet.fi/en
* Tags: post-formats, sticky-post, theme-options, threaded-comments, translation-ready, one-column, two-columns, flexible-width, left-sidebar, right-sidebar, custom-background, featured-images, editor-style, blue, white
@@ -362,7 +362,7 @@ img.wp-smiley {
#menu-primary li.current-menu-item a {
color: #1189b7;
}
-#menu-primary li:nth-child(2).current-menu-item {
+#menu-primary li:first-child.current-menu-item {
-webkit-border-top-left-radius: 10px;
-moz-border-radius-topleft: 10px;
border-top-left-radius: 10px;
@@ -373,8 +373,8 @@ img.wp-smiley {
color: #1189b7;
text-decoration: none;
}
-#menu-primary li:nth-child(2) a:hover,
-#menu-primary li:nth-child(2).sfHover a {
+#menu-primary li:first-child a:hover,
+#menu-primary li:first-child.sfHover a {
-webkit-border-top-left-radius: 10px;
-moz-border-radius-topleft: 10px;
border-top-left-radius: 10px;
@@ -389,11 +389,11 @@ img.wp-smiley {
padding-left: 2.27272727em; /* 25px / 11px = 2.2727272 */
text-transform: none;
}
-#menu-primary li li:nth-child(2) a:hover,
-#menu-primary li:nth-child(2).sfHover li a,
-#menu-primary li li:nth-child(2).sfHover li a,
-#menu-primary li:nth-child(2).sfHover li a,
-#menu-primary li li:nth-child(2).sfHover li a {
+#menu-primary li li:first-child a:hover,
+#menu-primary li:first-child.sfHover li a,
+#menu-primary li li:first-child.sfHover li a,
+#menu-primary li:first-child.sfHover li a,
+#menu-primary li li:first-child.sfHover li a {
-webkit-border-top-left-radius: 0;
-moz-border-radius-topleft: 0;
border-top-left-radius: 0;
Please sign in to comment.
Something went wrong with that request. Please try again.