woocommerce/assets/js/price_slider.min.js

1 line
2.7 KiB
JavaScript
Raw Normal View History

jQuery(document).ready(function(b){b("input#min_price, input#max_price").hide();b(".price_slider, .price_label").show();var a=b(".price_slider_amount #min_price").attr("data-min");var c=b(".price_slider_amount #max_price").attr("data-max");current_min_price=parseInt(a);current_max_price=parseInt(c);if(woocommerce_price_slider_params.min_price){current_min_price=parseInt(woocommerce_price_slider_params.min_price)}if(woocommerce_price_slider_params.max_price){current_max_price=parseInt(woocommerce_price_slider_params.max_price)}b(".price_slider").slider({range:true,animate:true,min:a,max:c,values:[current_min_price,current_max_price],create:function(d,e){if(woocommerce_price_slider_params.currency_pos=="left"){b(".price_slider_amount span").html(woocommerce_price_slider_params.currency_symbol+current_min_price+" - "+woocommerce_price_slider_params.currency_symbol+current_max_price)}else{if(woocommerce_price_slider_params.currency_pos=="left_space"){b(".price_slider_amount span").html(woocommerce_price_slider_params.currency_symbol+" "+current_min_price+" - "+woocommerce_price_slider_params.currency_symbol+" "+current_max_price)}else{if(woocommerce_price_slider_params.currency_pos=="right"){b(".price_slider_amount span").html(current_min_price+woocommerce_price_slider_params.currency_symbol+" - "+current_max_price+woocommerce_price_slider_params.currency_symbol)}else{if(woocommerce_price_slider_params.currency_pos=="right_space"){b(".price_slider_amount span").html(current_min_price+" "+woocommerce_price_slider_params.currency_symbol+" - "+current_max_price+" "+woocommerce_price_slider_params.currency_symbol)}}}}b(".price_slider_amount #min_price").val(current_min_price);b(".price_slider_amount #max_price").val(current_max_price)},slide:function(d,e){if(woocommerce_price_slider_params.currency_pos=="left"){b(".price_slider_amount span").html(woocommerce_price_slider_params.currency_symbol+e.values[0]+" - "+woocommerce_price_slider_params.currency_symbol+e.values[1])}else{if(woocommerce_price_slider_params.currency_pos=="left_space"){b(".price_slider_amount span").html(woocommerce_price_slider_params.currency_symbol+" "+e.values[0]+" - "+woocommerce_price_slider_params.currency_symbol+" "+e.values[1])}else{if(woocommerce_price_slider_params.currency_pos=="right"){b(".price_slider_amount span").html(e.values[0]+woocommerce_price_slider_params.currency_symbol+" - "+e.values[1]+woocommerce_price_slider_params.currency_symbol)}else{if(woocommerce_price_slider_params.currency_pos=="right_space"){b(".price_slider_amount span").html(e.values[0]+" "+woocommerce_price_slider_params.currency_symbol+" - "+e.values[1]+" "+woocommerce_price_slider_params.currency_symbol)}}}}b("input#min_price").val(e.values[0]);b("input#max_price").val(e.values[1])}})});