1function JCSmartFilter(ajaxURL, viewMode, params) 2{ 3 this.ajaxURL = ajaxURL; 4 this.form = null; 5 this.timer = null; 6 this.cacheKey = ''; 7 this.cache = []; 8 this.popups = []; 9 this.viewMode = viewMode; 10 if (params && params.SEF_SET_FILTER_URL) 11 { 12 this.bindUrlToButton('set_filter', params.SEF_SET_FILTER_URL); 13 this.sef = true; 14 } 15 if (params && params.SEF_DEL_FILTER_URL) 16 { 17 this.bindUrlToButton('del_filter', params.SEF_DEL_FILTER_URL); 18 } 19} 20 21JCSmartFilter.prototype.keyup = function(input) 22{ 23 if(!!this.timer) 24 { 25 clearTimeout(this.timer); 26 } 27 this.timer = setTimeout(BX.delegate(function(){ 28 this.reload(input); 29 }, this), 500); 30}; 31 32JCSmartFilter.prototype.click = function(checkbox) 33{ 34 if(!!this.timer) 35 { 36 clearTimeout(this.timer); 37 } 38 39 this.timer = setTimeout(BX.delegate(function(){ 40 this.reload(checkbox); 41 }, this), 500); 42}; 43 44JCSmartFilter.prototype.reload = function(input) 45{ 46 if (this.cacheKey !== '') 47 { 48 //Postprone backend query 49 if(!!this.timer) 50 { 51 clearTimeout(this.timer); 52 } 53 this.timer = setTimeout(BX.delegate(function(){ 54 this.reload(input); 55 }, this), 1000); 56 return; 57 } 58 this.cacheKey = '|'; 59 60 this.position = BX.pos(input, true); 61 this.form = BX.findParent(input, {'tag':'form'}); 62 if (this.form) 63 { 64 var values = []; 65 values[0] = {name: 'ajax', value: 'y'}; 66 this.gatherInputsValues(values, BX.findChildren(this.form, {'tag': new RegExp('^(input|select)$', 'i')}, true)); 67 68 for (var i = 0; i < values.length; i++) 69 this.cacheKey += values[i].name + ':' + values[i].value + '|'; 70 71 if (this.cache[this.cacheKey]) 72 { 73 this.curFilterinput = input; 74 this.postHandler(this.cache[this.cacheKey], true); 75 } 76 else 77 { 78 if (this.sef) 79 { 80 var set_filter = BX('set_filter'); 81 set_filter.disabled = true; 82 } 83 84 this.curFilterinput = input; 85 BX.ajax.loadJSON( 86 this.ajaxURL, 87 this.values2post(values), 88 BX.delegate(this.postHandler, this) 89 ); 90 } 91 } 92}; 93 94JCSmartFilter.prototype.updateItem = function (PID, arItem) 95{ 96 if (arItem.PROPERTY_TYPE === 'N' || arItem.PRICE) 97 { 98 var trackBar = window['trackBar' + PID]; 99 if (!trackBar && arItem.ENCODED_ID) 100 trackBar = window['trackBar' + arItem.ENCODED_ID]; 101 102 if (trackBar && arItem.VALUES) 103 { 104 if (arItem.VALUES.MIN) 105 { 106 if (arItem.VALUES.MIN.FILTERED_VALUE) 107 trackBar.setMinFilteredValue(arItem.VALUES.MIN.FILTERED_VALUE); 108 else 109 trackBar.setMinFilteredValue(arItem.VALUES.MIN.VALUE); 110 } 111 112 if (arItem.VALUES.MAX) 113 { 114 if (arItem.VALUES.MAX.FILTERED_VALUE) 115 trackBar.setMaxFilteredValue(arItem.VALUES.MAX.FILTERED_VALUE); 116 else 117 trackBar.setMaxFilteredValue(arItem.VALUES.MAX.VALUE); 118 } 119 } 120 } 121 else if (arItem.VALUES) 122 { 123 for (var i in arItem.VALUES) 124 { 125 if (arItem.VALUES.hasOwnProperty(i)) 126 { 127 var value = arItem.VALUES[i]; 128 var control = BX(value.CONTROL_ID); 129 130 if (!!control) 131 { 132 var label = document.querySelector('[data-role="label_'+value.CONTROL_ID+'"]'); 133 if (value.DISABLED) 134 { 135 if (label) 136 BX.addClass(label, 'disabled'); 137 else 138 BX.addClass(control.parentNode, 'disabled'); 139 } 140 else 141 { 142 if (label) 143 BX.removeClass(label, 'disabled'); 144 else 145 BX.removeClass(control.parentNode, 'disabled'); 146 } 147 148 if (value.hasOwnProperty('ELEMENT_COUNT')) 149 { 150 label = document.querySelector('[data-role="count_'+value.CONTROL_ID+'"]'); 151 if (label) 152 label.innerHTML = value.ELEMENT_COUNT; 153 } 154 } 155 } 156 } 157 } 158}; 159 160JCSmartFilter.prototype.postHandler = function (result, fromCache) 161{ 162 var hrefFILTER, url, curProp; 163 var modef = BX('modef'); 164 var modef_num = BX('modef_num'); 165 166 if (!!result && !!result.ITEMS) 167 { 168 for(var popupId in this.popups) 169 { 170 if (this.popups.hasOwnProperty(popupId)) 171 { 172 this.popups[popupId].destroy(); 173 } 174 } 175 this.popups = []; 176 177 for(var PID in result.ITEMS) 178 { 179 if (result.ITEMS.hasOwnProperty(PID)) 180 { 181 this.updateItem(PID, result.ITEMS[PID]); 182 } 183 } 184 if (result.SEF_SET_FILTER_URL) 185 { 186 this.bindUrlToButton('set_filter', result.SEF_SET_FILTER_URL); 187 } 188 /*if (!!modef && !!modef_num) 189 { 190 modef_num.innerHTML = result.ELEMENT_COUNT; 191 hrefFILTER = BX.findChildren(modef, {tag: 'A'}, true); 192 193 if (result.FILTER_URL && hrefFILTER) 194 { 195 hrefFILTER[0].href = BX.util.htmlspecialcharsback(result.FILTER_URL); 196 } 197 198 if (result.FILTER_AJAX_URL && result.COMPONENT_CONTAINER_ID) 199 { 200 BX.unbindAll(hrefFILTER[0]); 201 BX.bind(hrefFILTER[0], 'click', function(e) 202 { 203 url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL); 204 BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID); 205 return BX.PreventDefault(e); 206 }); 207 } 208 209 if (result.INSTANT_RELOAD && result.COMPONENT_CONTAINER_ID) 210 { 211 url = BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL); 212 BX.ajax.insertToNode(url, result.COMPONENT_CONTAINER_ID); 213 } 214 else 215 {
216 if (modef.style.display === 'none') 217 { 218 modef.style.display = 'inline-block'; 219 } 220 221 if (this.viewMode == "VERTICAL") 222 { 223 curProp = BX.findChild(BX.findParent(this.curFilterinput, {'class':'bx-filter-parameters-box'}), {'class':'bx-filter-container-modef'}, true, false); 224 curProp.appendChild(modef); 225 } 226 227 if (result.SEF_SET_FILTER_URL) 228 { 229 this.bindUrlToButton('set_filter', result.SEF_SET_FILTER_URL); 230 } 231 } 232 }*/ 233 } 234 235 if (this.sef) 236 { 237 var set_filter = BX('set_filter'); 238 set_filter.disabled = false; 239 } 240 241 if (!fromCache && this.cacheKey !== '') 242 { 243 this.cache[this.cacheKey] = result; 244 } 245 this.cacheKey = ''; 246}; 247 248JCSmartFilter.prototype.bindUrlToButton = function (buttonId, url) 249{ 250 var button = BX(buttonId); 251 if (button) 252 { 253 var proxy = function(j, func) 254 { 255 return function() 256 { 257 return func(j); 258 } 259 }; 260 261 if (button.type == 'submit') 262 button.type = 'button'; 263 264 BX.bind(button, 'click', proxy(url, function(url) 265 { 266 window.location.href = url; 267 return false; 268 })); 269 } 270}; 271 272JCSmartFilter.prototype.gatherInputsValues = function (values, elements) 273{ 274 if(elements) 275 { 276 for(var i = 0; i < elements.length; i++) 277 { 278 var el = elements[i]; 279 if (el.disabled || !el.type) 280 continue; 281 282 switch(el.type.toLowerCase()) 283 { 284 case 'text': 285 case 'textarea': 286 case 'password': 287 case 'hidden': 288 case 'select-one': 289 if(el.value.length) 290 values[values.length] = {name : el.name, value : el.value}; 291 break; 292 case 'radio': 293 case 'checkbox': 294 if(el.checked) 295 values[values.length] = {name : el.name, value : el.value}; 296 break; 297 case 'select-multiple': 298 for (var j = 0; j < el.options.length; j++) 299 { 300 if (el.options[j].selected) 301 values[values.length] = {name : el.name, value : el.options[j].value}; 302 } 303 break; 304 default: 305 break; 306 } 307 } 308 } 309}; 310 311JCSmartFilter.prototype.values2post = function (values) 312{ 313 var post = []; 314 var current = post; 315 var i = 0; 316 317 while(i < values.length) 318 { 319 var p = values[i].name.indexOf('['); 320 if(p == -1) 321 { 322 current[values[i].name] = values[i].value; 323 current = post; 324 i++; 325 } 326 else 327 { 328 var name = values[i].name.substring(0, p); 329 var rest = values[i].name.substring(p+1); 330 if(!current[name]) 331 current[name] = []; 332 333 var pp = rest.indexOf(']'); 334 if(pp == -1) 335 { 336 //Error - not balanced brackets 337 current = post; 338 i++; 339 } 340 else if(pp == 0) 341 { 342 //No index specified - so take the next integer 343 current = current[name]; 344 values[i].name = '' + current.length; 345 } 346 else 347 { 348 //Now index name becomes and name and we go deeper into the array 349 current = current[name]; 350 values[i].name = rest.substring(0, pp) + rest.substring(pp+1); 351 } 352 } 353 } 354 return post; 355}; 356 357JCSmartFilter.prototype.hideFilterProps = function(element) 358{ 359 var obj = element.parentNode, 360 filterBlock = obj.querySelector("[data-role='bx_filter_block']"), 361 propAngle = obj.querySelector("[data-role='prop_angle']"); 362 363 if(BX.hasClass(obj, "bx-active")) 364 { 365 new BX.easing({ 366 duration : 300, 367 start : { opacity: 1, height: filterBlock.offsetHeight }, 368 finish : { opacity: 0, height:0 }, 369 transition : BX.easing.transitions.quart, 370 step : function(state){ 371 filterBlock.style.opacity = state.opacity; 372 filterBlock.style.height = state.height + "px"; 373 }, 374 complete : function() { 375 filterBlock.setAttribute("style", ""); 376 BX.removeClass(obj, "bx-active"); 377 } 378 }).animate(); 379 380 BX.addClass(propAngle, "fa-angle-down"); 381 BX.removeClass(propAngle, "fa-angle-up"); 382 } 383 else 384 { 385 filterBlock.style.display = "block"; 386 filterBlock.style.opacity = 0; 387 filterBlock.style.height = "auto"; 388 389 var obj_children_height = filterBlock.offsetHeight; 390 filterBlock.style.height = 0; 391 392 new BX.easing({ 393 duration : 300, 394 start : { opacity: 0, height: 0 }, 395 finish : { opacity: 1, height: obj_children_height }, 396 transition : BX.easing.transitions.quart, 397 step : function(state){ 398 filterBlock.style.opacity = state.opacity; 399 filterBlock.style.height = state.height + "px"; 400 },
401 complete : function() { 402 } 403 }).animate(); 404 405 BX.addClass(obj, "bx-active"); 406 BX.removeClass(propAngle, "fa-angle-down"); 407 BX.addClass(propAngle, "fa-angle-up"); 408 } 409}; 410 411JCSmartFilter.prototype.showDropDownPopup = function(element, popupId) 412{ 413 var contentNode = element.querySelector('[data-role="dropdownContent"]'); 414 this.popups["smartFilterDropDown"+popupId] = BX.PopupWindowManager.create("smartFilterDropDown"+popupId, element, { 415 autoHide: true, 416 offsetLeft: 0, 417 offsetTop: 3, 418 overlay : false, 419 draggable: {restrict:true}, 420 closeByEsc: true, 421 content: BX.clone(contentNode) 422 }); 423 this.popups["smartFilterDropDown"+popupId].show(); 424}; 425 426JCSmartFilter.prototype.selectDropDownItem = function(element, controlId) 427{ 428 this.keyup(BX(controlId)); 429 430 var wrapContainer = BX.findParent(BX(controlId), {className:"bx-filter-select-container"}, false); 431 432 var currentOption = wrapContainer.querySelector('[data-role="currentOption"]'); 433 currentOption.innerHTML = element.innerHTML; 434 BX.PopupWindowManager.getCurrentPopup().close(); 435}; 436 437BX.namespace("BX.Iblock.SmartFilter"); 438BX.Iblock.SmartFilter = (function() 439{ 440 /** @param {{ 441 leftSlider: string, 442 rightSlider: string, 443 tracker: string, 444 trackerWrap: string, 445 minInputId: string, 446 maxInputId: string, 447 minPrice: float|int|string, 448 maxPrice: float|int|string, 449 curMinPrice: float|int|string, 450 curMaxPrice: float|int|string, 451 fltMinPrice: float|int|string|null, 452 fltMaxPrice: float|int|string|null, 453 precision: int|null, 454 colorUnavailableActive: string, 455 colorAvailableActive: string, 456 colorAvailableInactive: string 457 }} arParams 458 */ 459 var SmartFilter = function(arParams) 460 { 461 if (typeof arParams === 'object') 462 { 463 this.leftSlider = BX(arParams.leftSlider); 464 this.rightSlider = BX(arParams.rightSlider); 465 this.tracker = BX(arParams.tracker); 466 this.trackerWrap = BX(arParams.trackerWrap); 467 468 this.minInput = BX(arParams.minInputId); 469 this.maxInput = BX(arParams.maxInputId); 470 471 this.minPrice = parseFloat(arParams.minPrice); 472 this.maxPrice = parseFloat(arParams.maxPrice); 473 474 this.curMinPrice = parseFloat(arParams.curMinPrice); 475 this.curMaxPrice = parseFloat(arParams.curMaxPrice); 476 477 this.fltMinPrice = arParams.fltMinPrice ? parseFloat(arParams.fltMinPrice) : parseFloat(arParams.curMinPrice); 478 this.fltMaxPrice = arParams.fltMaxPrice ? parseFloat(arParams.fltMaxPrice) : parseFloat(arParams.curMaxPrice); 479 480 this.precision = arParams.precision || 0; 481 482 this.priceDiff = this.maxPrice - this.minPrice; 483 484 this.leftPercent = 0; 485 this.rightPercent = 0; 486 487 this.fltMinPercent = 0; 488 this.fltMaxPercent = 0; 489 490 this.isTouch = false; 491 492 this.init(); 493 494 if ('ontouchstart' in document.documentElement) 495 { 496 this.isTouch = true; 497 498 BX.bind(this.leftSlider, "touchstart", BX.proxy(function(event){ 499 this.onMoveLeftSlider(event) 500 }, this)); 501 502 BX.bind(this.rightSlider, "touchstart", BX.proxy(function(event){ 503 this.onMoveRightSlider(event) 504 }, this)); 505 } 506 else 507 { 508 BX.bind(this.leftSlider, "mousedown", BX.proxy(function(event){ 509 this.onMoveLeftSlider(event) 510 }, this)); 511 512 BX.bind(this.rightSlider, "mousedown", BX.proxy(function(event){ 513 this.onMoveRightSlider(event) 514 }, this)); 515 } 516 517 BX.bind(this.minInput, "keyup", BX.proxy(function(event){ 518 this.onInputChange(); 519 }, this)); 520 521 BX.bind(this.maxInput, "keyup", BX.proxy(function(event){ 522 this.onInputChange(); 523 }, this)); 524 } 525 }; 526 527 SmartFilter.prototype.init = function() 528 { 529 var priceDiff; 530 531 if (this.curMinPrice > this.minPrice) 532 { 533 priceDiff = this.curMinPrice - this.minPrice; 534 this.leftPercent = (priceDiff*100)/this.priceDiff; 535 } 536 537 this.setMinFilteredValue(this.fltMinPrice); 538 539 if (this.curMaxPrice < this.maxPrice) 540 { 541 priceDiff = this.maxPrice - this.curMaxPrice; 542 this.rightPercent = (priceDiff*100)/this.priceDiff; 543 } 544 545 this.setMaxFilteredValue(this.fltMaxPrice); 546 547 this.reloadSlider(); 548 }; 549 550 SmartFilter.prototype.setMinFilteredValue = function (fltMinPrice) 551 { 552 this.fltMinPrice = parseFloat(fltMinPrice); 553 if (this.fltMinPrice >= this.minPrice) 554 { 555 var priceDiff = this.fltMinPrice - this.minPrice; 556 this.fltMinPercent = (priceDiff*100)/this.priceDiff; 557 } 558 }; 559 560 SmartFilter.prototype.setMaxFilteredValue = function (fltMaxPrice) 561 { 562 this.fltMaxPrice = parseFloat(fltMaxPrice); 563 if (this.fltMaxPrice <= this.maxPrice) 564 { 565 var priceDiff = this.maxPrice - this.fltMaxPrice; 566 this.fltMaxPercent = (priceDiff*100)/this.priceDiff; 567 } 568 }; 569 570 SmartFilter.prototype.getXCoord = function(elem) 571 { 572 var box = elem.getBoundingClientRect(); 573 var body = document.body; 574 var docElem = document.documentElement; 575 576 var scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft; 577 var clientLeft = docElem.clientLeft || body.clientLeft || 0; 578 var left = box.left + scrollLeft - clientLeft; 579 580 return Math.round(left); 581 }; 582 583 SmartFilter.prototype.getPageX = function(e) 584 { 585 e = e || window.event; 586 var pageX = null; 587 588 if (this.isTouch && event.targetTouches[0] != null) 589 { 590 pageX = e.targetTouches[0].pageX; 591 } 592 else if (e.pageX != null) 593 { 594 pageX = e.pageX; 595 } 596 else if (e.clientX != null) 597 { 598 var html = document.documentElement; 599 var body = document.body; 600 601 pageX = e.clientX + (html.scrollLeft || body && body.scrollLeft || 0); 602 pageX -= html.clientLeft || 0; 603 } 604 605 return pageX; 606 }; 607 608 SmartFilter.prototype.recountMinPrice = function() 609 { 610 var newMinPrice = (this.priceDiff*this.leftPercent)/100; 611 newMinPrice = (this.minPrice + newMinPrice).toFixed(this.precision); 612 613 if (newMinPrice != this.minPrice) 614 this.minInput.value = newMinPrice; 615 else 616 this.minInput.value = ""; 617 /** @global JCSmartFilter smartFilter */ 618 smartFilter.keyup(this.minInput); 619 }; 620 621 SmartFilter.prototype.recountMaxPrice = function() 622 { 623 var newMaxPrice = (this.priceDiff*this.rightPercent)/100; 624 newMaxPrice = (this.maxPrice - newMaxPrice).toFixed(this.precision); 625 626 if (newMaxPrice != this.maxPrice) 627 this.maxInput.value = newMaxPrice; 628 else 629 this.maxInput.value = ""; 630 /** @global JCSmartFilter smartFilter */ 631 smartFilter.keyup(this.maxInput); 632 }; 633 634 SmartFilter.prototype.onInputChange = function () 635 { 636 var priceDiff; 637 if (this.minInput.value) 638 { 639 var leftInputValue = this.minInput.value; 640 if (leftInputValue < this.minPrice) 641 leftInputValue = this.minPrice; 642 643 if (leftInputValue > this.maxPrice) 644 leftInputValue = this.maxPrice; 645 646 priceDiff = leftInputValue - this.minPrice; 647 this.leftPercent = (priceDiff*100)/this.priceDiff; 648 649 this.makeLeftSliderMove(false); 650 } 651 652 if (this.maxInput.value) 653 { 654 var rightInputValue = this.maxInput.value; 655 if (rightInputValue < this.minPrice) 656 rightInputValue = this.minPrice; 657 658 if (rightInputValue > this.maxPrice) 659 rightInputValue = this.maxPrice; 660 661 priceDiff = this.maxPrice - rightInputValue; 662 this.rightPercent = (priceDiff*100)/this.priceDiff; 663 664 this.makeRightSliderMove(false); 665 } 666 }; 667 668 SmartFilter.prototype.makeLeftSliderMove = function(recountPrice) 669 { 670 recountPrice = (recountPrice !== false); 671 672 var areBothSlidersMoving = false;
673 if (this.leftPercent + this.rightPercent >= 100) 674 { 675 areBothSlidersMoving = true; 676 this.rightPercent = 100 - this.leftPercent; 677 } 678 679 if (recountPrice) 680 { 681 this.recountMinPrice(); 682 if (areBothSlidersMoving) 683 this.recountMaxPrice(); 684 } 685 }; 686 687 SmartFilter.prototype.countNewLeft = function(event) 688 { 689 var pageX = this.getPageX(event); 690 691 var trackerXCoord = this.getXCoord(this.trackerWrap); 692 var rightEdge = this.trackerWrap.offsetWidth; 693 694 var newLeft = pageX - trackerXCoord; 695 696 if (newLeft < 0) 697 newLeft = 0; 698 else if (newLeft > rightEdge) 699 newLeft = rightEdge; 700 701 return newLeft; 702 }; 703 704 SmartFilter.prototype.onMoveLeftSlider = function(e) 705 { 706 if (!this.isTouch) 707 { 708 this.leftSlider.ondragstart = function() { 709 return false; 710 }; 711 } 712 713 if (!this.isTouch) 714 { 715 document.onmousemove = BX.proxy(function(event) { 716 this.leftPercent = ((this.countNewLeft(event)*100)/this.trackerWrap.offsetWidth); 717 this.makeLeftSliderMove(); 718 }, this); 719 720 document.onmouseup = function() { 721 document.onmousemove = document.onmouseup = null; 722 }; 723 } 724 else 725 { 726 document.ontouchmove = BX.proxy(function(event) { 727 this.leftPercent = ((this.countNewLeft(event)*100)/this.trackerWrap.offsetWidth); 728 this.makeLeftSliderMove(); 729 }, this); 730 731 document.ontouchend = function() { 732 document.ontouchmove = document.touchend = null; 733 }; 734 } 735 736 return false; 737 }; 738 739 SmartFilter.prototype.makeRightSliderMove = function(recountPrice) 740 { 741 recountPrice = (recountPrice !== false); 742 743 this.rightSlider.style.right = this.rightPercent + "%"; 744 745 var areBothSlidersMoving = false; 746 if (this.leftPercent + this.rightPercent >= 100) 747 { 748 areBothSlidersMoving = true; 749 this.leftPercent = 100 - this.rightPercent; 750 } 751 752 if (recountPrice) 753 { 754 this.recountMaxPrice(); 755 if (areBothSlidersMoving) 756 this.recountMinPrice(); 757 } 758 }; 759 760 SmartFilter.prototype.onMoveRightSlider = function(e) 761 { 762 if (!this.isTouch) 763 { 764 this.rightSlider.ondragstart = function() { 765 return false; 766 }; 767 } 768 769 if (!this.isTouch) 770 { 771 document.onmousemove = BX.proxy(function(event) { 772 this.rightPercent = 100-(((this.countNewLeft(event))*100)/(this.trackerWrap.offsetWidth)); 773 this.makeRightSliderMove(); 774 }, this); 775 776 document.onmouseup = function() { 777 document.onmousemove = document.onmouseup = null; 778 }; 779 } 780 else 781 { 782 document.ontouchmove = BX.proxy(function(event) { 783 this.rightPercent = 100-(((this.countNewLeft(event))*100)/(this.trackerWrap.offsetWidth)); 784 this.makeRightSliderMove(); 785 }, this); 786 787 document.ontouchend = function() { 788 document.ontouchmove = document.ontouchend = null; 789 }; 790 } 791 792 return false; 793 }; 794 795 SmartFilter.prototype.reloadSlider = function () { 796 var curMinPrice = this.minPrice; 797 var curMaxPrice = this.maxPrice; 798 799 var priceInput_1 = $('#price-input-1'), 800 priceInput_2 = $('#price-input-2'), 801 priceFilterSlider = $('#slider-price'); 802 803 priceInput_1.change(function () { 804 var val = $(this).val(); 805 priceFilterSlider.slider('values', 0, val); 806 }); 807 808 priceInput_2.change(function () { 809 var val = $(this).val(); 810 priceFilterSlider.slider('values', 1, val); 811 }); 812 if(this.minPrice !== this.curMinPrice && this.curMinPrice){ 813 curMinPrice = this.curMinPrice; 814 } 815 816 if(this.maxPrice !== this.curMaxPrice && this.curMaxPrice){ 817 curMaxPrice = this.curMaxPrice; 818 } 819 820 priceFilterSlider.slider({ 821 values: [curMinPrice, curMaxPrice], 822 min: this.minPrice, 823 max: this.maxPrice, 824 // step:100, 825 range: true, 826 slide: function (event, ui) { 827 if(priceInput_1.val() != ui.values[0]){ 828 priceInput_1.val(ui.values[0]); 829 smartFilter.reload(document.getElementById('price-input-1')); 830 }else if(priceInput_2.val() != ui.values[1]){ 831 priceInput_2.val(ui.values[1]); 832 smartFilter.reload(document.getElementById('price-input-2')); 833 } 834 } 835 }); 836 priceInput_1.val(priceFilterSlider.slider("values", 0)); 837 priceInput_2.val(priceFilterSlider.slider("values", 1)); 838 } 839 840 return SmartFilter; 841})(); 842window.addEventListener('load', () => { 843//PRICE FILTER 844 845})
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.