Commit 4d1ab6e484ae7d4ccf5030c63cbb175046c87468

Authored by Yarik
2 parents 031cdeed 5a24921e

Merge remote-tracking branch 'origin/master'

frontend/views/category/view.php
... ... @@ -185,6 +185,9 @@ _________________________________________________________ -->
185 185 <input type="text" name="price-max" id="price-max">
186 186 </div>
187 187 </div>
  188 + <div class="col-md-12 row">
  189 + <button class="price-apply">применить</button>
  190 + </div>
188 191  
189 192 </div>
190 193 </div>
... ...
frontend/web/css/style.css
... ... @@ -4884,4 +4884,16 @@ a i.fa, button i.fa, span.fa {
4884 4884 .irs-from, .irs-to, .irs-single {display: none;}
4885 4885 .lt-ie9 .irs-from, .lt-ie9 .irs-to, .lt-ie9 .irs-single {background: #999;}
4886 4886  
4887   -/* Range Slider Styles End */
4888 4887 \ No newline at end of file
  4888 +/* Range Slider Styles End */
  4889 +
  4890 +button.price-apply{
  4891 + background-color: #428bca;
  4892 + border: none;
  4893 + padding: 8px 20px;
  4894 + border-radius: 5px;
  4895 + color: #fff;
  4896 +}
  4897 +
  4898 +button.price-apply:hover{
  4899 + background-color:#005bac;
  4900 +}
4889 4901 \ No newline at end of file
... ...
frontend/web/js/script.js
... ... @@ -280,6 +280,10 @@ $(document).ready(function ($) {
280 280 });
281 281  
282 282 $(function(){
  283 + $('.price-inputs input').keypress(function(key) {
  284 + if(key.charCode < 48 || key.charCode > 57) return false;
  285 + });
  286 +
283 287 var pricemin = $(".price_slider input").data("pricemin");
284 288 pricemax = $(".price_slider input").data("pricemax");
285 289 $(".price-inputs #price-min").val(pricemin);
... ... @@ -301,10 +305,28 @@ $(function(){
301 305  
302 306 $(document).on('change','.price-inputs #price-min',function(){
303 307 var newmin = $(this).val();
  308 + currentmax = $(".price-inputs #price-max").val();
  309 + if(newmin > currentmax){
  310 + newmin = currentmax;
  311 + $('.price-inputs #price-min').val(currentmax);
  312 + }
  313 + else if(newmin > pricemax){
  314 + newmin = pricemax;
  315 + $('.price-inputs #price-min').val(pricemax);
  316 + }
304 317 slider.update({from: newmin});
305 318 });
306 319 $(document).on('change','.price-inputs #price-max',function(){
307 320 var newmax = $(this).val();
  321 + currentmin = $(".price-inputs #price-min").val();
  322 + if(newmax < currentmin){
  323 + newmax = currentmin;
  324 + $('.price-inputs #price-max').val(currentmin);
  325 + }
  326 + else if(newmax > pricemax){
  327 + newmax = pricemax;
  328 + $('.price-inputs #price-max').val(pricemax);
  329 + }
308 330 slider.update({to: newmax});
309 331 });
310 332 });
... ...