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