1 line
1.9 KiB
JavaScript
1 line
1.9 KiB
JavaScript
jQuery(function(e){if("undefined"==typeof woocommerce_price_slider_params)return!1;e("input#min_price, input#max_price").hide(),e(".price_slider, .price_label").show();var r=e(".price_slider_amount #min_price").data("min"),c=e(".price_slider_amount #max_price").data("max"),i=parseInt(r,10),_=parseInt(c,10);woocommerce_price_slider_params.min_price&&(i=parseInt(woocommerce_price_slider_params.min_price,10)),woocommerce_price_slider_params.max_price&&(_=parseInt(woocommerce_price_slider_params.max_price,10)),e(document.body).bind("price_slider_create price_slider_slide",function(r,c,i){e(".price_slider_amount span.from").html(accounting.formatMoney(c,{symbol:woocommerce_price_slider_params.currency_format_symbol,decimal:woocommerce_price_slider_params.currency_format_decimal_sep,thousand:woocommerce_price_slider_params.currency_format_thousand_sep,precision:woocommerce_price_slider_params.currency_format_num_decimals,format:woocommerce_price_slider_params.currency_format})),e(".price_slider_amount span.to").html(accounting.formatMoney(i,{symbol:woocommerce_price_slider_params.currency_format_symbol,decimal:woocommerce_price_slider_params.currency_format_decimal_sep,thousand:woocommerce_price_slider_params.currency_format_thousand_sep,precision:woocommerce_price_slider_params.currency_format_num_decimals,format:woocommerce_price_slider_params.currency_format})),e(document.body).trigger("price_slider_updated",[c,i])}),e(".price_slider").slider({range:!0,animate:!0,min:r,max:c,values:[i,_],create:function(){e(".price_slider_amount #min_price").val(i),e(".price_slider_amount #max_price").val(_),e(document.body).trigger("price_slider_create",[i,_])},slide:function(r,c){e("input#min_price").val(c.values[0]),e("input#max_price").val(c.values[1]),e(document.body).trigger("price_slider_slide",[c.values[0],c.values[1]])},change:function(r,c){e(document.body).trigger("price_slider_change",[c.values[0],c.values[1]])}})}); |