Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
puro-support committed Feb 5, 2021
2 parents 499bd0c + 3c7be72 commit 67794ea
Show file tree
Hide file tree
Showing 12 changed files with 289 additions and 137 deletions.
2 changes: 1 addition & 1 deletion inc/extras
1 change: 1 addition & 0 deletions inc/styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function polestar_build_styles() {
'#infinite-handle span button',
'#infinite-handle span button:hover',
'.added_to_cart',
'.widget_shopping_cart .buttons a:first-of-type:hover',
'input[type="button"]',
'input[type="reset"]',
'input[type="submit"]',
Expand Down
14 changes: 11 additions & 3 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,24 @@ function polestar_author_box() { ?>

if ( ! function_exists( 'polestar_breadcrumbs' ) ) :
/**
* Display Yoast SEO breadcrumbs or Breadcrumb NavXT below the header.
* Displays breadcrumbs supported by Breadcrumb NavXT, Rank Math, and Yoast SEO.
*/
function polestar_breadcrumbs() {
if ( puro_page_setting( 'overlap' ) != 'disabled' ) return;
if ( function_exists( 'bcn_display' ) ) {
?><div class="breadcrumbs bcn">
?>
<div class="breadcrumbs bcn">
<?php bcn_display(); ?>
</div><?php
</div>
<?php
} elseif ( function_exists( 'yoast_breadcrumb' ) ) {
yoast_breadcrumb( '<div class="breadcrumbs">','</div>' );
} elseif ( function_exists( 'rank_math_the_breadcrumbs' ) ) {
?>
<div class="breadcrumbs">
<?php rank_math_the_breadcrumbs(); ?>
</div>
<?php
}
}
endif;
Expand Down
132 changes: 97 additions & 35 deletions js/jquery.flexslider.js
100755 → 100644

Large diffs are not rendered by default.

87 changes: 49 additions & 38 deletions js/jquery.theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

/* globals jQuery, polestar */

jQuery( function( $ ) {
( function( $ ) {

// Element viewport visibility.
$.fn.polestarIsVisible = function() {
Expand Down Expand Up @@ -73,17 +73,17 @@ jQuery( function( $ ) {

// Header search.
var $hs = $( '#header-search' );
$( '#masthead .search-icon' ).click( function() {
$( '#masthead .search-icon' ).on( 'click', function() {
$hs.fadeIn( 'fast' );
$hs.find( 'form' ).css( 'margin-top', - $hs.find( 'form' ).innerHeight() / 2 );
$hs.find( 'input[type="search"]' ).focus().select();
$hs.find( 'input[type="search"]' ).trigger( 'focus' ).trigger( 'select' );
$hs.find( '#close-search' ).addClass( 'animate-in' );
} );
$hs.find( '#close-search' ).click( function() {
$hs.find( '#close-search' ).on( 'click', function() {
$hs.fadeOut( 350 );
$( this ).removeClass( 'animate-in' );
} );
$( window ).scroll( function() {
$( window ).on( 'scroll', function() {
if ( $hs.is( ':visible' ) ) {
$hs.find( 'form' ).css( 'margin-top', - $hs.find( 'form' ).outerHeight() / 2 );
}
Expand All @@ -93,13 +93,13 @@ jQuery( function( $ ) {
$( '#header-search input[type=search]' ).on( 'focusout', function( e ) {
if ( $( 'body' ).hasClass( 'disable-search-close' ) ) {
return;
}
}
$( '#close-search.animate-in' ).trigger( 'click' );
} );

// Close the header search with the escape key.
$( document ).keyup( function( e ) {
if ( e.keyCode === 27 ) { // Escape key maps to keycode 27.
// Close search with escape key.
$( document ).on( 'keyup', function( e ) {
if ( e.keyCode == 27 ) { // Escape key maps to keycode `27`.
$( '#close-search.animate-in' ).trigger( 'click' );
}
} );
Expand All @@ -110,16 +110,16 @@ jQuery( function( $ ) {
if ( $( 'body' ).hasClass( 'css3-animations' ) ) {

// Add keyboard access to the menu.
$( '.menu-item' ).children( 'a' ).focus( function() {
$( '.menu-item' ).children( 'a' ).on( 'focusin', function() {
$( this ).parents( 'ul, li' ).addClass( 'focus' );
} );

// Click event fires after focus event.
$( '.menu-item' ).children( 'a' ).click( function() {
$( '.menu-item' ).children( 'a' ).on( 'click', function() {
$( this ).parents( 'ul, li' ).removeClass( 'focus' );
} );
$( '.menu-item' ).children( 'a' ).focusout( function() {

$( '.menu-item' ).children( 'a' ).on( 'focusout', function() {
$( this ).parents( 'ul, li' ).removeClass( 'focus' );
} );
}
Expand All @@ -132,7 +132,7 @@ jQuery( function( $ ) {
} else {
$( '#site-navigation a[href="'+ window.location.href +'"]' ).parent( 'li' ).addClass( 'current-menu-item' );
}
$( window ).scroll( function() {
$( window ).on( 'click', function() {
if ( $( '#site-navigation ul li' ).hasClass( 'current' ) ) {
$( '#site-navigation li' ).removeClass( 'current-menu-item' );
$( '#site-navigation li.current-menu-ancestor' ).removeClass( 'current-menu-ancestor current-menu-parent' );
Expand Down Expand Up @@ -178,10 +178,11 @@ jQuery( function( $ ) {
}

// Smooth scroll from internal page anchors.
headerHeight = function() {
var calcHeaderHeight = function() {
var adminBarHeight = $( '#wpadminbar' ).outerHeight(),
isAdminBar = $( 'body' ).hasClass( 'admin-bar' ),
isStickyHeader = $( 'header' ).hasClass( 'sticky' ),
$mh = $( '.site-header' ),
headerHeight;

// Header height. 1px to account for header shadow.
Expand All @@ -192,6 +193,12 @@ jQuery( function( $ ) {
} else {
headerHeight = 0;
}

if ( $mh.data( 'scale-logo' ) && ! $mh.hasClass( 'stuck' ) ) {
var mhPadding = parseInt( $mh.css( 'padding-bottom' ) );
headerHeight += mhPadding - mhPadding * polestar.logoScale * 2;
}

return headerHeight;
};

Expand All @@ -201,7 +208,7 @@ jQuery( function( $ ) {
return;
}

$( this ).click( function( e ) {
$( this ).on( 'click', function( e ) {

var hash = this.hash;
var idName = hash.substring( 1 ); // Get ID name.
Expand All @@ -219,7 +226,7 @@ jQuery( function( $ ) {
target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) +']' );
if ( target.length ) {
$( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight()
scrollTop: target.offset().top - calcHeaderHeight()
},
{
duration: 1200,
Expand All @@ -238,20 +245,27 @@ jQuery( function( $ ) {
} );
};

$( window ).load( function() {
$( '#site-navigation a[href*="#"]:not([href="#"]), .comments-link a[href*="#"]:not([href="#"]), .puro-scroll[href*="#"]:not([href="#"])' ).polestarSmoothScroll();
} );

// Adjust for sticky header when linking from external anchors.
$( window ).load( function() {
$( window ).on( 'load', function() {
$( '#site-navigation a[href*="#"]:not([href="#"]), .comments-link a[href*="#"]:not([href="#"]), .woocommerce-review-link[href*="#"]:not([href="#"]), .puro-scroll[href*="#"]:not([href="#"])' ).polestarSmoothScroll();

// Adjust for sticky header when linking from external anchors.
if ( location.pathname.replace( /^\//,'' ) == window.location.pathname.replace( /^\//,'' ) && location.hostname == window.location.hostname ) {
var target = $( window.location.hash );
if ( target.length ) {
$( 'html, body' ).animate( {
scrollTop: target.offset().top - headerHeight()
}, 0 );
return false;
setTimeout( function() {
$( 'html, body' ).animate(
{
scrollTop: target.offset().top - calcHeaderHeight()
},
0,
function() {
if ( $( '#masthead' ).hasClass( 'sticky-menu' ) ) {
// Avoid a situation where the logo can be incorrectly sized due to the page jump.
smSetup();
}
}
);
}, 100 );
}
}
} );
Expand All @@ -278,10 +292,10 @@ jQuery( function( $ ) {
var thisHeight = $( this ).outerHeight();

// Where the section begins.
var thisBegin = offset - headerHeight();
var thisBegin = offset - calcHeaderHeight();

// Where the section ends.
var thisEnd = offset + thisHeight - headerHeight();
var thisEnd = offset + thisHeight - calcHeaderHeight();

// If position of the cursor is inside of the this section.
if ( scrollTop >= thisBegin && scrollTop <= thisEnd ) {
Expand All @@ -301,7 +315,7 @@ jQuery( function( $ ) {

// Mobile menu.
var $mobileMenu = false;
$( '#mobile-menu-button' ).click( function( e ) {
$( '#mobile-menu-button' ).on( 'click', function( e ) {
e.preventDefault();
var $$ = $( this );
$$.toggleClass( 'to-close' );
Expand All @@ -324,7 +338,7 @@ jQuery( function( $ ) {
$mobileMenu.find( '.menu-item-has-children > a' ).addClass( 'has-dropdown' );
$mobileMenu.find( '.page_item_has_children > a' ).addClass( 'has-dropdown' );
$mobileMenu.find( '.has-dropdown' ).after( '<button class="dropdown-toggle" aria-expanded="false"><i class="icon-chevron-down" aria-hidden="true"></i></button>' );
$mobileMenu.find( '.dropdown-toggle' ).click( function( e ) {
$mobileMenu.find( '.dropdown-toggle' ).on( 'click', function( e ) {
e.preventDefault();
$( this ).toggleClass( 'toggle-open' ).next( '.children, .sub-menu' ).slideToggle( 'fast' );
} );
Expand All @@ -346,14 +360,14 @@ jQuery( function( $ ) {
}
mmOverflow();

$( window ).resize( mmOverflow );
$( window ).on( 'resize', mmOverflow );
$( '#mobile-navigation' ).scroll( mmOverflow );

}

$mobileMenu.slideToggle( 'fast' );

$( '#mobile-navigation a' ).click( function( e ) {
$( '#mobile-navigation a' ).on( 'click', function( e ) {
if ( ! $( this ).hasClass( 'has-dropdown' ) || ( typeof $( this ).attr( 'href' ) !== "undefined" && $( this ).attr( 'href' ) !== "#" ) ) {
if ( $mobileMenu.is(' :visible' ) ) {
$mobileMenu.slideUp( 'fast' );
Expand All @@ -366,9 +380,6 @@ jQuery( function( $ ) {

} );

} );

( function( $ ) {
$( window ).on( 'load', function() {

polestar.logoScale = parseFloat( polestar.logoScale );
Expand Down Expand Up @@ -475,7 +486,7 @@ jQuery( function( $ ) {
};

smSetup();
$( window ).resize( smSetup ).scroll( smSetup );
$( window ).on( 'resize scroll', smSetup );

// Sticky header shadow.
var smShadow = function() {
Expand All @@ -486,7 +497,7 @@ jQuery( function( $ ) {
}
};
smShadow();
$( window ).scroll( smShadow );
$( window ).on( 'scroll', smShadow );

}

Expand Down
9 changes: 8 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: Puro

Tags: one-column, two-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-menu, custom-logo, featured-images, footer-widgets, full-width-template, post-formats, sticky-post, theme-options, threaded-comments, translation-ready, blog, e-commerce

Tested up to: 5.5
Tested up to: 5.6
Requires at least: 4.7
Requires PHP: 5.6.20
License: GPLv2 or later
Expand Down Expand Up @@ -93,6 +93,7 @@ Polestar includes support for the following plugins:
* [Jetpack Related Posts](https://jetpack.com/support/related-posts/)
* [Max Mega Menu](https://wordpress.org/plugins/megamenu/)
* [Page Builder by SiteOrigin](https://wordpress.org/plugins/siteorigin-panels/)
* [Rank Math Breadcrumbs](https://wordpress.org/plugins/seo-by-rank-math/)
* [Yet Another Related Posts Plugin (YARPP)](https://wordpress.org/plugins/yet-another-related-posts-plugin/)
* [Yoast Breadcrumbs](https://wordpress.org/plugins/wordpress-seo/)
* [WooCommerce](https://wordpress.org/plugins/woocommerce/)
Expand Down Expand Up @@ -151,6 +152,12 @@ Released under [GPL version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0

== Changelog ==

= 1.5.0 - 04 February 2020 =
* Added RankMath breadcrumb support.
* WooCommerce: Linked mini-cart View Cart hover color setting to `Accent Color`.
* WooCommerce: Improved Quick View gallery variation support.
* Developer: Added support for jQuery 3.5.

= 1.4.2 - 06 September 2020 =
* Added Block Editor support for Wide Alignment.

Expand Down
2 changes: 1 addition & 1 deletion sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Author URI: https://purothemes.com/
Theme URI: https://purothemes.com/themes/polestar/
Description: Lead the way with Polestar. It's fast loading, responsive, lightweight and flexible design is perfectly suited for building dynamic pages with SiteOrigin's Page Builder and selling with WooCommerce. Ecommerce features include a menu mini-cart and product quick-view. Polestar features a sticky header, beautiful header search, scroll to top and just the right amount of Customizer theme settings. Page level settings let you adjust the theme layout on a page by page basis, perfect for landing pages. If you run a blog, Polestar is ready with awesome features including a full-width posts slider integrated with Jetpack Featured Content, an author box and related posts section. For assistance, check out our <a href="http://purothemes.com/documentation/">theme documentation</a> (http://purothemes.com/documentation/) or ask a question on our <a href="https://purothemes.com/support/">support forum</a> (https://purothemes.com/support/).
Version: dev
Tested up to: 5.5
Tested up to: 5.6
Requires at least: 4.7
Requires PHP: 5.6.20
License: GNU General Public License v2 or later
Expand Down
48 changes: 43 additions & 5 deletions sass/woocommerce/_quick-view.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,54 @@

.flex-direction-nav a {

svg path {
fill: rgba(45, 45, 45, 0.8);
}

&:hover {

svg path {
fill: rgba(130, 130, 130, .8);
fill: rgba(45, 45, 45, 1);
}
}
}

.flex-control-nav {
bottom: 30px;
margin: 0;
padding: 0;
position: absolute;
text-align: center;
width: 100%;

svg {
@media (max-width: 480px) {
display: none;
}

path {
fill: rgba(130, 130, 130, .5);
li {
display: inline-block;
margin: 0 5px;

a {
border: 2px solid rgba(45, 45, 45, 0.8);
border-radius: 20px;
cursor: pointer;
display: block;
height: 10px;
text-indent: -9999px;
width: 10px;

&:hover {
background: rgba(45, 45, 45, 0.8);
}

&.flex-active {
background: rgba(45, 45, 45, 0.8);
cursor: default;
}
}
}
}
}
}

.product-info-wrapper {
Expand Down Expand Up @@ -112,6 +146,10 @@
margin-left: 0;
position: absolute;
}

.woocommerce-variation-description {
display: none;
}
}
}
}
2 changes: 1 addition & 1 deletion style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 67794ea

Please sign in to comment.