AkashSaikia

Slide Change event handlers

Apr 7th, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jPriceSliderEl.unbind().on("change", function(slideEvt) {
  2.  
  3.     if ((slideEvt.value === null) || (typeof slideEvt.value === "undefined") || (slideEvt.value == "")) {
  4.  
  5.         $(slideEvt.target).closest('.widget__block').find('.min-limit').text(price_min_set);
  6.         $(slideEvt.target).closest('.widget__block').find('.max-limit').text(price_max_set);
  7.  
  8.     }
  9. });
  10.  
  11.  
  12. jPriceSliderEl.unbind().on("slideStop", function(slideEvt) {
  13.     {
  14.  
  15.         var Country = $('input[name=Country]').val();
  16.         var date = $('input[name=date]').val();
  17.  
  18.         if ((Country === null) || (typeof Country === "undefined") || (Country == "")) {
  19.  
  20.             Country = getParameterByName('SearchText');
  21.  
  22.             if ((Country === null) || (typeof Country === "undefined") || (Country == "")) {
  23.  
  24.                 Country = '';
  25.  
  26.             }
  27.  
  28.         }
  29.  
  30.         if ((date === null) || (typeof date === "undefined") || (date == "")) {
  31.  
  32.             date = getParameterByName('date');
  33.  
  34.             if ((date === null) || (typeof date === "undefined") || (date == "")) {
  35.  
  36.                 date = '';
  37.  
  38.             }
  39.  
  40.         }
  41.  
  42.         if ((Country == '') || (date == '')) {
  43.  
  44.             return false;
  45.         }
  46.  
  47.         var date_url = getParameterByName('date');
  48.         var Country_url = getParameterByName('SearchText');
  49.  
  50.  
  51.         $(slideEvt.target).closest('.widget__block').find('.min-limit').text(slideEvt.value.newValue[0]);
  52.         $(slideEvt.target).closest('.widget__block').find('.max-limit').text(slideEvt.value.newValue[1]);
  53.  
  54.         $scope.minPrice = slideEvt.value.newValue[0];
  55.         $('#price-min').val($scope.minPrice);
  56.         $scope.maxPrice = slideEvt.value.newValue[1];
  57.         $('#price-max').val($scope.maxPrice);
  58.  
  59.         var url = window.location.href;
  60.  
  61.         url = updateQueryStringParameter(url, 'price_min', $scope.minPrice);
  62.         url = updateQueryStringParameter(url, 'price_max', $scope.maxPrice);
  63.  
  64.         if ((date_url === null) || (typeof date_url === "undefined") || (date_url == "")) {
  65.  
  66.             url = updateQueryStringParameter(url, 'date', date);
  67.  
  68.         }
  69.  
  70.         if ((Country_url === null) || (typeof Country_url === "undefined") || (Country_url == "")) {
  71.  
  72.             url = updateQueryStringParameter(url, 'SearchText', Country);
  73.  
  74.         }
  75.  
  76.         window.location.href = url;
  77.  
  78.     }
  79.  
  80. });
Add Comment
Please, Sign In to add comment