Merge pull request #28014 from JoryHogeveen/feature/20-10-20-price-slider-init-trigger

Widget: Price Slider - trigger to re-initialize
This commit is contained in:
Roy Ho 2020-12-08 13:35:10 -08:00 committed by GitHub
commit 8f37a6936f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -6,7 +6,7 @@ jQuery( function( $ ) {
return false;
}
$( document.body ).bind( 'price_slider_create price_slider_slide', function( event, min, max ) {
$( document.body ).on( 'price_slider_create price_slider_slide', function( event, min, max ) {
$( '.price_slider_amount span.from' ).html( accounting.formatMoney( min, {
symbol: woocommerce_price_slider_params.currency_format_symbol,
@ -66,6 +66,7 @@ jQuery( function( $ ) {
}
init_price_filter();
$( document.body ).on( 'init_price_filter', init_price_filter );
var hasSelectiveRefresh = (
'undefined' !== typeof wp &&
@ -75,7 +76,7 @@ jQuery( function( $ ) {
wp.customize.widgetsPreview.WidgetPartial
);
if ( hasSelectiveRefresh ) {
wp.customize.selectiveRefresh.bind( 'partial-content-rendered', function() {
wp.customize.selectiveRefresh.on( 'partial-content-rendered', function() {
init_price_filter();
} );
}