From 5a24921e2f468429776af4403c6f56c45a05522f Mon Sep 17 00:00:00 2001 From: Eugeny Galkovskiy Date: Fri, 2 Jun 2017 19:06:42 +0300 Subject: [PATCH] Бегунок цены --- frontend/views/category/view.php | 3 +++ frontend/web/css/style.css | 14 +++++++++++++- frontend/web/js/script.js | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/frontend/views/category/view.php b/frontend/views/category/view.php index d8543c7..97bff92 100755 --- a/frontend/views/category/view.php +++ b/frontend/views/category/view.php @@ -185,6 +185,9 @@ _________________________________________________________ --> +
+ +
diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css index 6b2b29c..9939720 100755 --- a/frontend/web/css/style.css +++ b/frontend/web/css/style.css @@ -4884,4 +4884,16 @@ a i.fa, button i.fa, span.fa { .irs-from, .irs-to, .irs-single {display: none;} .lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single {background: #999;} -/* Range Slider Styles End */ \ No newline at end of file +/* Range Slider Styles End */ + +button.price-apply{ + background-color: #428bca; + border: none; + padding: 8px 20px; + border-radius: 5px; + color: #fff; +} + +button.price-apply:hover{ + background-color:#005bac; +} \ No newline at end of file diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index 5ee2537..63b9df5 100755 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -280,6 +280,10 @@ $(document).ready(function ($) { }); $(function(){ + $('.price-inputs input').keypress(function(key) { + if(key.charCode < 48 || key.charCode > 57) return false; + }); + var pricemin = $(".price_slider input").data("pricemin"); pricemax = $(".price_slider input").data("pricemax"); $(".price-inputs #price-min").val(pricemin); @@ -301,10 +305,28 @@ $(function(){ $(document).on('change','.price-inputs #price-min',function(){ var newmin = $(this).val(); + currentmax = $(".price-inputs #price-max").val(); + if(newmin > currentmax){ + newmin = currentmax; + $('.price-inputs #price-min').val(currentmax); + } + else if(newmin > pricemax){ + newmin = pricemax; + $('.price-inputs #price-min').val(pricemax); + } slider.update({from: newmin}); }); $(document).on('change','.price-inputs #price-max',function(){ var newmax = $(this).val(); + currentmin = $(".price-inputs #price-min").val(); + if(newmax < currentmin){ + newmax = currentmin; + $('.price-inputs #price-max').val(currentmin); + } + else if(newmax > pricemax){ + newmax = pricemax; + $('.price-inputs #price-max').val(pricemax); + } slider.update({to: newmax}); }); }); -- libgit2 0.21.4