mirror of
https://github.com/woocommerce/storefront.git
synced 2025-10-04 14:11:16 +08:00
cart dropdown on focus. closes #151
This commit is contained in:
parent
6255818e40
commit
6e428d6200
5 changed files with 16 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
|||
# Storefront Changelog
|
||||
|
||||
### *2015.03.31* - 1.4.3
|
||||
* **Tweak** - Cart dropdown appears on focus.
|
||||
|
||||
### *2015.03.24* - 1.4.2
|
||||
* **Fix** - Navigation not displaying if no menu is assigned to primary location.
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1340,7 +1340,8 @@ dl.variation {
|
|||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
&:hover,
|
||||
&.focus {
|
||||
.widget_shopping_cart {
|
||||
left: 0;
|
||||
}
|
||||
|
|
|
@ -45,5 +45,13 @@
|
|||
// Add focus class to li
|
||||
jQuery( '.main-navigation, .secondary-navigation' ).find( 'a' ).on( 'focus.storefront blur.storefront', function() {
|
||||
jQuery( this ).parents().toggleClass( 'focus' );
|
||||
} );
|
||||
});
|
||||
|
||||
// Add focus to cart dropdown
|
||||
jQuery( window ).load( function() {
|
||||
jQuery( '.site-header-cart' ).find( 'a' ).on( 'focus.storefront blur.storefront', function() {
|
||||
jQuery( this ).parents().toggleClass( 'focus' );
|
||||
});
|
||||
});
|
||||
|
||||
} )();
|
||||
|
|
2
js/navigation.min.js
vendored
2
js/navigation.min.js
vendored
|
@ -1 +1 @@
|
|||
!function(){var a,b,c;if(a=document.getElementById("site-navigation"),a&&(b=a.getElementsByTagName("button")[0],"undefined"!=typeof b)){if(c=a.getElementsByTagName("ul")[0],"undefined"==typeof c)return void(b.style.display="none");c.setAttribute("aria-expanded","false"),-1===c.className.indexOf("nav-menu")&&(c.className+=" nav-menu"),b.onclick=function(){-1!==a.className.indexOf("toggled")?(a.className=a.className.replace(" toggled",""),b.setAttribute("aria-expanded","false"),c.setAttribute("aria-expanded","false")):(a.className+=" toggled",b.setAttribute("aria-expanded","true"),c.setAttribute("aria-expanded","true"))},jQuery(".main-navigation, .secondary-navigation").find("a").on("focus.storefront blur.storefront",function(){jQuery(this).parents().toggleClass("focus")})}}();
|
||||
!function(){var a,b,c;if(a=document.getElementById("site-navigation"),a&&(b=a.getElementsByTagName("button")[0],"undefined"!=typeof b)){if(c=a.getElementsByTagName("ul")[0],"undefined"==typeof c)return void(b.style.display="none");c.setAttribute("aria-expanded","false"),-1===c.className.indexOf("nav-menu")&&(c.className+=" nav-menu"),b.onclick=function(){-1!==a.className.indexOf("toggled")?(a.className=a.className.replace(" toggled",""),b.setAttribute("aria-expanded","false"),c.setAttribute("aria-expanded","false")):(a.className+=" toggled",b.setAttribute("aria-expanded","true"),c.setAttribute("aria-expanded","true"))},jQuery(".main-navigation, .secondary-navigation").find("a").on("focus.storefront blur.storefront",function(){jQuery(this).parents().toggleClass("focus")}),jQuery(window).load(function(){jQuery(".site-header-cart").find("a").on("focus.storefront blur.storefront",function(){jQuery(this).parents().toggleClass("focus")})})}}();
|
Loading…
Add table
Add a link
Reference in a new issue