vendor: 16,384 bytes, lines 1-545
1 2; /* Start:"a:4:{s:4:"full";s:64:"/bitrix/templates/aspro_max/js/lite.bootstrap.js?175076295819575";s:6:"source";s:48:"/bitrix/templates/aspro_max/js/lite.bootstrap.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 3+function ($) { "use strict"; 4 5 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 6 // ============================================================ 7 8 function transitionEnd() { 9 var el = document.createElement('bootstrap') 10 11 var transEndEventNames = { 12 'WebkitTransition' : 'webkitTransitionEnd' 13 , 'MozTransition' : 'transitionend' 14 , 'OTransition' : 'oTransitionEnd otransitionend' 15 , 'transition' : 'transitionend' 16 } 17 18 for (var name in transEndEventNames) { 19 if (el.style[name] !== undefined) { 20 return { end: transEndEventNames[name] } 21 } 22 } 23 } 24 25 // http://blog.alexmaccaw.com/css-transitions 26 $.fn.emulateTransitionEnd = function (duration) { 27 var called = false, $el = this 28 $(this).one($.support.transition.end, function () { called = true }) 29 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 30 setTimeout(callback, duration) 31 return this 32 } 33 34 $(function () { 35 $.support.transition = transitionEnd() 36 }) 37 38}(window.jQuery); 39 40+function ($) { "use strict"; 41 42 // TOOLTIP PUBLIC CLASS DEFINITION 43 // =============================== 44 45 var Tooltip = function (element, options) { 46 this.type = 47 this.options = 48 this.enabled = 49 this.timeout = 50 this.hoverState = 51 this.$element = null 52 53 this.init('tooltip', element, options) 54 } 55 56 Tooltip.DEFAULTS = { 57 animation: true 58 , placement: 'top' 59 , selector: false 60 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' 61 , trigger: 'hover focus' 62 , title: '' 63 , delay: 0 64 , html: false 65 , container: false 66 } 67 68 Tooltip.prototype.init = function (type, element, options) { 69 this.enabled = true 70 this.type = type 71 this.$element = $(element) 72 this.options = this.getOptions(options) 73 74 var triggers = this.options.trigger.split(' ') 75 76 for (var i = triggers.length; i--;) { 77 var trigger = triggers[i] 78 79 if (trigger == 'click') { 80 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 81 } else if (trigger != 'manual') { 82 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' 83 var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' 84 85 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 86 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 87 } 88 } 89 90 this.options.selector ? 91 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 92 this.fixTitle() 93 } 94 95 Tooltip.prototype.getDefaults = function () { 96 return Tooltip.DEFAULTS 97 } 98 99 Tooltip.prototype.getOptions = function (options) { 100 options = $.extend({}, this.getDefaults(), this.$element.data(), options) 101 102 if (options.delay && typeof options.delay == 'number') { 103 options.delay = { 104 show: options.delay 105 , hide: options.delay 106 } 107 } 108 109 return options 110 } 111 112 Tooltip.prototype.getDelegateOptions = function () { 113 var options = {} 114 var defaults = this.getDefaults() 115 116 this._options && $.each(this._options, function (key, value) { 117 if (defaults[key] != value) options[key] = value 118 }) 119 120 return options 121 } 122 123 Tooltip.prototype.enter = function (obj) { 124 var self = obj instanceof this.constructor ? 125 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) 126 127 clearTimeout(self.timeout) 128 129 self.hoverState = 'in' 130 131 if (!self.options.delay || !self.options.delay.show) return self.show() 132 133 self.timeout = setTimeout(function () { 134 if (self.hoverState == 'in') self.show() 135 }, self.options.delay.show) 136 } 137 138 Tooltip.prototype.leave = function (obj) { 139 var self = obj instanceof this.constructor ? 140 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) 141 142 clearTimeout(self.timeout) 143 144 self.hoverState = 'out' 145 146 if (!self.options.delay || !self.options.delay.hide) return self.hide() 147 148 self.timeout = setTimeout(function () { 149 if (self.hoverState == 'out') self.hide() 150 }, self.options.delay.hide) 151 } 152 153 Tooltip.prototype.show = function () { 154 var e = $.Event('show.bs.'+ this.type) 155 156 if (this.hasContent() && this.enabled) { 157 this.$element.trigger(e) 158 159 if (e.isDefaultPrevented()) return 160 161 var $tip = this.tip() 162 163 this.setContent() 164 165 if (this.options.animation) $tip.addClass('fade') 166 167 var placement = typeof this.options.placement == 'function' ? 168 this.options.placement.call(this, $tip[0], this.$element[0]) : 169 this.options.placement 170 171 var autoToken = /\s?auto?\s?/i 172 var autoPlace = autoToken.test(placement) 173 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 174 175 $tip 176 .detach() 177 .css({ top: 0, left: 0, display: 'block' }) 178 .addClass(placement) 179 180 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) 181 182 var pos = this.getPosition() 183 var actualWidth = $tip[0].offsetWidth 184 var actualHeight = $tip[0].offsetHeight 185 186 if (autoPlace) { 187 var $parent = this.$element.parent() 188 189 var orgPlacement = placement 190 var docScroll = document.documentElement.scrollTop || document.body.scrollTop 191 var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() 192 var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() 193 var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left 194 195 placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : 196 placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : 197 placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : 198 placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : 199 placement 200 201 $tip 202 .removeClass(orgPlacement) 203 .addClass(placement) 204 } 205 206 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 207 208 this.applyPlacement(calculatedOffset, placement) 209 this.$element.trigger('shown.bs.' + this.type) 210 } 211 } 212 213 Tooltip.prototype.applyPlacement = function(offset, placement) { 214 var replace 215 var $tip = this.tip() 216 var width = $tip[0].offsetWidth 217 var height = $tip[0].offsetHeight 218 219 // manually read margins because getBoundingClientRect includes difference 220 var marginTop = parseInt($tip.css('margin-top'), 10) 221 var marginLeft = parseInt($tip.css('margin-left'), 10) 222 223 // we must check for NaN for ie 8/9 224 if (isNaN(marginTop)) marginTop = 0 225 if (isNaN(marginLeft)) marginLeft = 0 226 227 offset.top = offset.top + marginTop 228 offset.left = offset.left + marginLeft 229 230 $tip 231 .offset(offset) 232 .addClass('in') 233 234 // check to see if placing tip in new offset caused the tip to resize itself 235 var actualWidth = $tip[0].offsetWidth 236 var actualHeight = $tip[0].offsetHeight 237 238 if (placement == 'top' && actualHeight != height) { 239 replace = true 240 offset.top = offset.top + height - actualHeight 241 } 242 243 if (/bottom|top/.test(placement)) { 244 var delta = 0 245 246 if (offset.left < 0) { 247 delta = offset.left * -2 248 offset.left = 0 249 250 $tip.offset(offset) 251 252 actualWidth = $tip[0].offsetWidth 253 actualHeight = $tip[0].offsetHeight 254 } 255 256 this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') 257 } else { 258 this.replaceArrow(actualHeight - height, actualHeight, 'top') 259 } 260 261 if (replace) $tip.offset(offset) 262 } 263 264 Tooltip.prototype.replaceArrow = function(delta, dimension, position) { 265 this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') 266 } 267 268 Tooltip.prototype.setContent = function () { 269 var $tip = this.tip() 270 var title = this.getTitle() 271 272 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) 273 $tip.removeClass('fade in top bottom left right') 274 } 275 276 Tooltip.prototype.hide = function () { 277 var that = this 278 var $tip = this.tip() 279 var e = $.Event('hide.bs.' + this.type) 280 281 function complete() { 282 if (that.hoverState != 'in') $tip.detach() 283 } 284 285 this.$element.trigger(e) 286 287 if (e.isDefaultPrevented()) return 288 289 $tip.removeClass('in') 290 291 $.support.transition && this.$tip.hasClass('fade') ? 292 $tip 293 .one($.support.transition.end, complete) 294 .emulateTransitionEnd(150) : 295 complete() 296 297 this.$element.trigger('hidden.bs.' + this.type) 298 299 return this 300 } 301 302 Tooltip.prototype.fixTitle = function () { 303 var $e = this.$element 304 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { 305 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 306 } 307 } 308 309 Tooltip.prototype.hasContent = function () { 310 return this.getTitle() 311 } 312 313 Tooltip.prototype.getPosition = function () { 314 var el = this.$element[0] 315 return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { 316 width: el.offsetWidth 317 , height: el.offsetHeight 318 }, this.$element.offset()) 319 } 320 321 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 322 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 323 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 324 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 325 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 326 } 327 328 Tooltip.prototype.getTitle = function () { 329 var title 330 var $e = this.$element 331 var o = this.options 332 333 title = $e.attr('data-original-title') 334 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 335 336 return title 337 } 338 339 Tooltip.prototype.tip = function () { 340 return this.$tip = this.$tip || $(this.options.template) 341 } 342 343 Tooltip.prototype.arrow = function () { 344 return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') 345 } 346 347 Tooltip.prototype.validate = function () { 348 if (!this.$element[0].parentNode) { 349 this.hide() 350 this.$element = null 351 this.options = null 352 } 353 } 354 355 Tooltip.prototype.enable = function () { 356 this.enabled = true 357 } 358 359 Tooltip.prototype.disable = function () { 360 this.enabled = false 361 } 362 363 Tooltip.prototype.toggleEnabled = function () { 364 this.enabled = !this.enabled 365 } 366 367 Tooltip.prototype.toggle = function (e) { 368 var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this 369 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 370 } 371 372 Tooltip.prototype.destroy = function () { 373 this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) 374 } 375 376 377 // TOOLTIP PLUGIN DEFINITION 378 // ========================= 379 380 var old = $.fn.tooltip 381 382 $.fn.tooltip = function (option) { 383 return this.each(function () { 384 var $this = $(this) 385 var data = $this.data('bs.tooltip') 386 var options = typeof option == 'object' && option 387 388 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 389 if (typeof option == 'string') data[option]() 390 }) 391 } 392 393 $.fn.tooltip.Constructor = Tooltip 394 395 396 // TOOLTIP NO CONFLICT 397 // =================== 398 399 $.fn.tooltip.noConflict = function () { 400 $.fn.tooltip = old 401 return this 402 } 403 404}(window.jQuery); 405 406+function ($) { "use strict"; 407 408 // COLLAPSE PUBLIC CLASS DEFINITION 409 // ================================ 410 411 var Collapse = function (element, options) { 412 this.$element = $(element) 413 this.options = $.extend({}, Collapse.DEFAULTS, options) 414 this.transitioning = null 415 416 if (this.options.parent) this.$parent = $(this.options.parent) 417 if (this.options.toggle) this.toggle() 418 } 419 420 Collapse.DEFAULTS = { 421 toggle: true 422 } 423 424 Collapse.prototype.dimension = function () { 425 var hasWidth = this.$element.hasClass('width') 426 return hasWidth ? 'width' : 'height' 427 } 428 429 Collapse.prototype.show = function () { 430 if (this.transitioning || this.$element.hasClass('in')) return 431 432 var startEvent = $.Event('show.bs.collapse') 433 this.$element.trigger(startEvent) 434 if (startEvent.isDefaultPrevented()) return 435 436 var actives = this.$parent && this.$parent.find('> .panel > .in') 437 438 if (actives && actives.length) { 439 var hasData = actives.data('bs.collapse') 440 if (hasData && hasData.transitioning) return 441 actives.collapse('hide') 442 hasData || actives.data('bs.collapse', null) 443 } 444 445 var dimension = this.dimension() 446 447 this.$element 448 .removeClass('collapse') 449 .addClass('collapsing') 450 [dimension](0) 451 452 this.transitioning = 1 453 454 var complete = function () { 455 this.$element 456 .removeClass('collapsing') 457 .addClass('in') 458 [dimension]('auto') 459 this.transitioning = 0 460 this.$element.trigger('shown.bs.collapse') 461 } 462 463 if (!$.support.transition) return complete.call(this) 464 465 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 466 467 this.$element 468 .one($.support.transition.end, $.proxy(complete, this)) 469 .emulateTransitionEnd(350) 470 [dimension](this.$element[0][scrollSize]) 471 } 472 473 Collapse.prototype.hide = function () { 474 if (this.transitioning || !this.$element.hasClass('in')) return 475 476 var startEvent = $.Event('hide.bs.collapse') 477 this.$element.trigger(startEvent) 478 if (startEvent.isDefaultPrevented()) return 479 480 var dimension = this.dimension() 481 482 this.$element 483 [dimension](this.$element[dimension]()) 484 [0].offsetHeight 485 486 this.$element 487 .addClass('collapsing') 488 .removeClass('collapse') 489 .removeClass('in') 490 491 this.transitioning = 1 492 493 var complete = function () { 494 this.transitioning = 0 495 this.$element 496 .trigger('hidden.bs.collapse') 497 .removeClass('collapsing') 498 .addClass('collapse') 499 } 500 501 if (!$.support.transition) return complete.call(this) 502 503 this.$element 504 [dimension](0) 505 .one($.support.transition.end, $.proxy(complete, this)) 506 .emulateTransitionEnd(350) 507 } 508 509 Collapse.prototype.toggle = function () { 510 this[this.$element.hasClass('in') ? 'hide' : 'show']() 511 } 512 513 514 // COLLAPSE PLUGIN DEFINITION 515 // ========================== 516 517 var old = $.fn.collapse 518 519 $.fn.collapse = function (option) { 520 return this.each(function () { 521 var $this = $(this) 522 var data = $this.data('bs.collapse') 523 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 524 525 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 526 if (typeof option == 'string') data[option]() 527 }) 528 } 529 530 $.fn.collapse.Constructor = Collapse 531 532 533 // COLLAPSE NO CONFLICT 534 // ==================== 535 536 $.fn.collapse.noConflict = function () { 537 $.fn.collapse = old 538 return this 539 } 540 541 542 // COLLAPSE DATA-API 543 // ================= 544 545 $(document).on('click.bs.collapse.data-api', '[data-toggle=
545collapse]', function (e) { 546 var $this = $(this), href 547 var target = $this.attr('data-target') 548 || e.preventDefault() 549 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 550 var $target = $(target) 551 var data = $target.data('bs.collapse') 552 var option = data ? 'toggle' : $this.data() 553 var parent = $this.attr('data-parent') 554 var $parent = parent && $(parent) 555 556 if (!data || !data.transitioning) { 557 if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') 558 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') 559 } 560 561 $target.collapse(option) 562 }) 563 564}(window.jQuery); 565 566+function ($) { "use strict"; 567 568 // TAB CLASS DEFINITION 569 // ==================== 570 571 var Tab = function (element) { 572 this.element = $(element) 573 } 574 575 Tab.prototype.show = function () { 576 var $this = this.element 577 var $ul = $this.closest('ul:not(.dropdown-menu)') 578 var selector = $this.attr('data-target') 579 580 if (!selector) { 581 selector = $this.attr('href') 582 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 583 } 584 585 if ($this.parent('li').hasClass('active')) return 586 587 var previous = $ul.find('.active:last a')[0] 588 var e = $.Event('show.bs.tab', { 589 relatedTarget: previous 590 }) 591 592 $this.trigger(e) 593 594 if (e.isDefaultPrevented()) return 595 596 var $target = $(selector) 597 598 this.activate($this.parent('li'), $ul) 599 this.activate($target, $target.parent(), function () { 600 $this.trigger({ 601 type: 'shown.bs.tab' 602 , relatedTarget: previous 603 }) 604 }) 605 } 606 607 Tab.prototype.activate = function (element, container, callback) { 608 var $active = container.find('> .active') 609 var transition = callback 610 && $.support.transition 611 && $active.hasClass('fade') 612 613 function next() { 614 $active 615 .removeClass('active') 616 .find('> .dropdown-menu > .active') 617 .removeClass('active') 618 619 element.addClass('active') 620 621 if (transition) { 622 element[0].offsetWidth // reflow for transition 623 element.addClass('in') 624 } else { 625 element.removeClass('fade') 626 } 627 628 if (element.parent('.dropdown-menu')) { 629 element.closest('li.dropdown').addClass('active') 630 } 631 632 callback && callback() 633 } 634 635 transition ? 636 $active 637 .one($.support.transition.end, next) 638 .emulateTransitionEnd(150) : 639 next() 640 641 $active.removeClass('in') 642 } 643 644 645 // TAB PLUGIN DEFINITION 646 // ===================== 647 648 var old = $.fn.tab 649 650 $.fn.tab = function ( option ) { 651 return this.each(function () { 652 var $this = $(this) 653 var data = $this.data('bs.tab') 654 655 if (!data) $this.data('bs.tab', (data = new Tab(this))) 656 if (typeof option == 'string') data[option]() 657 }) 658 } 659 660 $.fn.tab.Constructor = Tab 661 662 663 // TAB NO CONFLICT 664 // =============== 665 666 $.fn.tab.noConflict = function () { 667 $.fn.tab = old 668 return this 669 } 670 671 672 // TAB DATA-API 673 // ============ 674 675 $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 676 e.preventDefault() 677 $(this).tab('show') 678 }) 679 680}(window.jQuery); 681/* End */ 682; 683; /* Start:"a:4:{s:4:"full";s:66:"/bitrix/templates/aspro_max/js/jquery.actual.min.js?15941159261251";s:6:"source";s:51:"/bitrix/templates/aspro_max/js/jquery.actual.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 684/*! Copyright 2012, Ben Lin (http://dreamerslab.com/) 685 * Licensed under the MIT License (LICENSE.txt). 686 * 687 * Version: 1.0.18 688 * 689 * Requires: jQuery >= 1.2.3 690 */ 691(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a); 692}else{a(jQuery);}}(function(a){a.fn.addBack=a.fn.addBack||a.fn.andSelf;a.fn.extend({actual:function(b,l){if(!this[b]){throw'$.actual => The jQuery method "'+b+'" you called does not exist'; 693}var f={absolute:false,clone:false,includeMargin:false,display:"block"};var i=a.extend(f,l);var e=this.eq(0);var h,j;if(i.clone===true){h=function(){var m="position: absolute !important; top: -1000 !important; "; 694e=e.clone().attr("style",m).appendTo("body");};j=function(){e.remove();};}else{var g=[];var d="";var c;h=function(){c=e.parents().addBack().filter(":hidden"); 695d+="visibility: hidden !important; display: "+i.display+" !important; ";if(i.absolute===true){d+="position: absolute !important; ";}c.each(function(){var m=a(this); 696var n=m.attr("style");g.push(n);m.attr("style",n?n+";"+d:d);});};j=function(){c.each(function(m){var o=a(this);var n=g[m];if(n===undefined){o.removeAttr("style"); 697}else{o.attr("style",n);}});};}h();var k=/(outer)/.test(b)?e[b](i.includeMargin):e[b]();j();return k;}});})); 698/* End */ 699; 700; /* Start:"a:4:{s:4:"full";s:62:"/bitrix/templates/aspro_max/vendor/js/ripple.js?15941159264702";s:6:"source";
700s:47:"/bitrix/templates/aspro_max/vendor/js/ripple.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 701;(function($, document, Math){ 702 $.ripple = function(selector, options) { 703 704 var self = this; 705 706 var _log = self.log = function() { 707 if(self.defaults.debug && console && console.log) { 708 console.log.apply(console, arguments); 709 } 710 }; 711 712 self.selector = selector; 713 self.defaults = { 714 debug: false, 715 on: 'mousedown', 716 717 opacity: 0.4, 718 color: "auto", 719 multi: false, 720 721 duration: 0.7, 722 rate: function(pxPerSecond) { 723 return pxPerSecond; 724 }, 725 726 easing: 'linear' 727 }; 728 729 self.defaults = $.extend({}, self.defaults, options); 730 731 var Trigger = function(e) { 732 733 var $this = $(this); 734 var $ripple; 735 var settings; 736 737 $this.addClass('has-ripple'); 738 739 // This instances settings 740 settings = $.extend({}, self.defaults, $this.data()); 741 742 // Create the ripple element 743 if ( settings.multi || (!settings.multi && $this.find(".ripple").length === 0) ) { 744 $ripple = $("<span></span>").addClass("ripple"); 745 $ripple.appendTo($this); 746 747 _log('Create: Ripple'); 748 749 // Set ripple size 750 if (!$ripple.height() && !$ripple.width()) { 751 var size = Math.max($this.outerWidth(), $this.outerHeight()); 752 $ripple.css({ 753 height: size, 754 width: size 755 }); 756 _log('Set: Ripple size'); 757 } 758 759 // Give the user the ability to change the rate of the animation 760 // based on element width 761 if(settings.rate && typeof settings.rate == "function") { 762 763 // rate = pixels per second 764 var rate = Math.round( $ripple.width() / settings.duration ); 765 766 // new amount of pixels per second 767 var filteredRate = settings.rate(rate); 768 769 // Determine the new duration for the animation 770 var newDuration = ( $ripple.width() / filteredRate); 771 772 // Set the new duration if it has not changed 773 if(settings.duration.toFixed(2) !== newDuration.toFixed(2)) { 774 _log('Update: Ripple Duration', { 775 from: settings.duration, 776 to: newDuration 777 }); 778 settings.duration = newDuration; 779 } 780 } 781 782 // Set the color and opacity 783 var color = (settings.color == "auto") ? $this.css('color') : settings.color; 784 var css = { 785 animationDuration: (settings.duration).toString() + 's', 786 animationTimingFunction: settings.easing, 787 background: color, 788 opacity: settings.opacity 789 }; 790 791 _log('Set: Ripple CSS', css); 792 $ripple.css(css); 793 } 794 795 // Ensure we always have the ripple element 796 if(!settings.multi) { 797 _log('Set: Ripple Element'); 798 $ripple = $this.find(".ripple"); 799 } 800 801 // Kill animation 802 _log('Destroy: Ripple Animation'); 803 $ripple.removeClass("ripple-animate"); 804 805 806 // Retrieve coordinates 807 var x = e.pageX - $this.offset().left - $ripple.width() / 2; 808 var y = e.pageY - $this.offset().top - $ripple.height() / 2; 809 810 /** 811 * We want to delete the ripple elements if we allow multiple so we dont sacrifice any page 812 * performance. We don't do this on single ripples because once it has rendered, we only 813 * need to trigger paints thereafter. 814 */ 815 if(settings.multi) { 816 _log('Set: Ripple animationend event'); 817 $ripple.one('animationend webkitAnimationEnd oanimationend MSAnimationEnd', function() { 818 _log('Note: Ripple animation ended'); 819 _log('Destroy: Ripple'); 820 $(this).remove(); 821 }); 822 } 823 824 // Set position and animate 825 _log('Set: Ripple location'); 826 _log('Set: Ripple animation'); 827 $ripple.css({ 828 top: y + 'px', 829 left: x + 'px' 830 }).addClass("ripple-animate"); 831 }; 832 833 $(document).on(self.defaults.on, self.selector, Trigger); 834 }; 835})(jQuery, document, Math); 836 837/* End */ 838; 839; /* Start:"a:4:{s:4:"full";
839s:56:"/bitrix/templates/aspro_max/js/browser.js?15941159261032";s:6:"source";s:41:"/bitrix/templates/aspro_max/js/browser.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 840var matched, browser; 841 842jQuery.uaMatch = function( ua ) { 843 ua = ua.toLowerCase(); 844 845 var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || 846 /(webkit)[ \/]([\w.]+)/.exec( ua ) || 847 /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) || 848 /(msie)[\s?]([\w.]+)/.exec( ua ) || 849 /(trident)(?:.*? rv:([\w.]+)|)/.exec( ua ) || 850 ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) || 851 []; 852 853 return { 854 browser: match[ 1 ] || "", 855 version: match[ 2 ] || "0" 856 }; 857}; 858 859matched = jQuery.uaMatch( navigator.userAgent ); 860//IE 11+ fix (Trident) 861matched.browser = matched.browser == 'trident' ? 'msie' : matched.browser; 862browser = {}; 863 864if ( matched.browser ) { 865 browser[ matched.browser ] = true; 866 browser.version = matched.version; 867} 868 869// Chrome is Webkit, but Webkit is also Safari. 870if ( browser.chrome ) { 871 browser.webkit = true; 872} else if ( browser.webkit ) { 873 browser.safari = true; 874} 875 876jQuery.browser = browser; 877/* End */ 878; 879; /* Start:"a:4:{s:4:"full";s:71:"/bitrix/templates/aspro_max/vendor/js/sticky-sidebar.js?160320671025989";s:6:"source";s:55:"/bitrix/templates/aspro_max/vendor/js/sticky-sidebar.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 880(function (global, factory) { 881 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 882 typeof define === 'function' && define.amd ? define(['exports'], factory) : 883 (factory((global.StickySidebar = {}))); 884}(this, (function (exports) { 'use strict'; 885 886var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 887 888 889 890function unwrapExports (x) { 891 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; 892} 893 894function createCommonjsModule(fn, module) { 895 return module = { exports: {} }, fn(module, module.exports), module.exports; 896} 897 898var stickySidebar = createCommonjsModule(function (module, exports) { 899(function (global, factory) { 900 if (typeof undefined === "function" && undefined.amd) { 901 undefined(['exports'], factory); 902 } else { 903 factory(exports); 904 } 905})(commonjsGlobal, function (exports) { 906 Object.defineProperty(exports, "__esModule", { 907 value: true 908 }); 909 910 function _classCallCheck(instance, Constructor) { 911 if (!(instance instanceof Constructor)) { 912 throw new TypeError("Cannot call a class as a function"); 913 } 914 } 915 916 var _createClass = function () { 917 function defineProperties(target, props) { 918 for (var i = 0; i < props.length; i++) { 919 var descriptor = props[i]; 920 descriptor.enumerable = descriptor.enumerable || false; 921 descriptor.configurable = true; 922 if ("value" in descriptor) descriptor.writable = true; 923 Object.defineProperty(target, descriptor.key, descriptor); 924 } 925 } 926 927 return function (Constructor, protoProps, staticProps) { 928 if (protoProps) defineProperties(Constructor.prototype, protoProps); 929 if (staticProps) defineProperties(Constructor, staticProps); 930 return Constructor; 931 }; 932 }(); 933 934 /** 935 * Sticky Sidebar JavaScript Plugin. 936 * @version 3.3.4 937 * @author Ahmed Bouhuolia <[email protected]> 938 * @license The MIT License (MIT) 939 */ 940 var StickySidebar = function () { 941 942 // --------------------------------- 943 // # Define Constants 944 // --------------------------------- 945 // 946 var EVENT_KEY = '.stickySidebar'; 947 var DEFAULTS = { 948 /** 949 * Additional top spacing of the element when it becomes sticky. 950 * @type {Numeric|Function} 951 */ 952 topSpacing: 0, 953 954 /** 955 * Additional bottom spacing of the element when it becomes sticky. 956 * @type {Numeric|Function} 957 */ 958 bottomSpacing: 0, 959 960 /** 961 * Container sidebar selector to know what the beginning and end of sticky element. 962 * @type {String|False} 963 */ 964 containerSelector: false, 965 966 /** 967 * Inner wrapper selector. 968 * @type {String} 969 */ 970 innerWrapperSelector: '.inner-wrapper-sticky', 971 972 /** 973 * The name of CSS class to apply to elements when they have become stuck. 974 * @type {String|False} 975 */ 976 stickyClass: 'is-affixed', 977 978 /** 979 * Detect when sidebar and its container change height so re-calculate their dimensions. 980 * @type {Boolean} 981 */ 982 resizeSensor: true, 983 984 /** 985 * The sidebar returns to its normal position if its width below this value. 986 * @type {Numeric} 987 */ 988 minWidth: false 989 }; 990 991 // --------------------------------- 992 // # Class Definition 993 // --------------------------------- 994 // 995 /** 996 * Sticky Sidebar Class. 997 * @public 998 */ 999 1000 var StickySidebar = function () { 1001 1002 /** 1003 * Sticky Sidebar Constructor. 1004 * @constructor 1005 * @param {HTMLElement|String} sidebar - The sidebar element or sidebar selector. 1006 * @param {Object}
1006 options - The options of sticky sidebar. 1007 */ 1008 function StickySidebar(sidebar) { 1009 var _this = this; 1010 1011 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 1012 1013 _classCallCheck(this, StickySidebar); 1014 1015 this.options = StickySidebar.extend(DEFAULTS, options); 1016 1017 // Sidebar element query if there's no one, throw error. 1018 this.sidebar = 'string' === typeof sidebar ? document.querySelector(sidebar) : sidebar; 1019 if ('undefined' === typeof this.sidebar) throw new Error("There is no specific sidebar element."); 1020 1021 this.sidebarInner = false; 1022 this.container = this.sidebar.parentElement; 1023 1024 // Current Affix Type of sidebar element. 1025 this.affixedType = 'STATIC'; 1026 this.direction = 'down'; 1027 this.support = { 1028 transform: false, 1029 transform3d: false 1030 }; 1031 1032 this._initialized = false; 1033 this._reStyle = false; 1034 this._breakpoint = false; 1035 1036 // Dimensions of sidebar, container and screen viewport. 1037 this.dimensions = { 1038 translateY: 0, 1039 maxTranslateY: 0, 1040 topSpacing: 0, 1041 lastTopSpacing: 0, 1042 bottomSpacing: 0, 1043 lastBottomSpacing: 0, 1044 sidebarHeight: 0, 1045 sidebarWidth: 0, 1046 containerTop: 0, 1047 containerHeight: 0, 1048 viewportHeight: 0, 1049 viewportTop: 0, 1050 lastViewportTop: 0 1051 }; 1052 1053 // Bind event handlers for referencability. 1054 ['handleEvent'].forEach(function (method) { 1055 _this[method] = _this[method].bind(_this); 1056 }); 1057 1058 // Initialize sticky sidebar for first time. 1059 this.initialize(); 1060 } 1061 1062 /**
1063 * Initializes the sticky sidebar by adding inner wrapper, define its container, 1064 * min-width breakpoint, calculating dimensions, adding helper classes and inline style. 1065 * @private 1066 */ 1067 1068 1069 _createClass(StickySidebar, [{ 1070 key: 'initialize', 1071 value: function initialize() { 1072 var _this2 = this; 1073 1074 this._setSupportFeatures(); 1075 1076 // Get sticky sidebar inner wrapper, if not found, will create one. 1077 if (this.options.innerWrapperSelector) { 1078 this.sidebarInner = this.sidebar.querySelector(this.options.innerWrapperSelector); 1079 1080 if (null === this.sidebarInner) this.sidebarInner = false; 1081 } 1082 1083 if (!this.sidebarInner) { 1084 var wrapper = document.createElement('div'); 1085 wrapper.setAttribute('class', 'inner-wrapper-sticky'); 1086 this.sidebar.appendChild(wrapper); 1087 1088 while (this.sidebar.firstChild != wrapper) { 1089 wrapper.appendChild(this.sidebar.firstChild); 1090 }this.sidebarInner = this.sidebar.querySelector('.inner-wrapper-sticky'); 1091 } 1092 1093 // Container wrapper of the sidebar. 1094 if (this.options.containerSelector) { 1095 var containers = document.querySelectorAll(this.options.containerSelector);
1096 containers = Array.prototype.slice.call(containers); 1097 1098 containers.forEach(function (container, item) { 1099 if (!container.contains(_this2.sidebar)) return; 1100 _this2.container = container; 1101 }); 1102 1103 if (!containers.length) throw new Error("The container does not contains on the sidebar."); 1104 } 1105 1106 // If top/bottom spacing is not function parse value to integer. 1107 if ('function' !== typeof this.options.topSpacing) this.options.topSpacing = parseInt(this.options.topSpacing) || 0; 1108 1109 if ('function' !== typeof this.options.bottomSpacing) this.options.bottomSpacing = parseInt(this.options.bottomSpacing) || 0; 1110 1111 // Breakdown sticky sidebar if screen width below `options.minWidth`. 1112 this._widthBreakpoint(); 1113 1114 // Calculate dimensions of sidebar, container and viewport. 1115 this.calcDimensions(); 1116 1117 // Affix sidebar in proper position. 1118 this.stickyPosition(); 1119 1120 // Bind all events. 1121 this.bindEvents(); 1122
vendor: 4,110 bytes, lines 1123-1220
1123 // Inform other properties the sticky sidebar is initialized. 1124 this._initialized = true; 1125 } 1126 }, { 1127 key: 'bindEvents', 1128 value: function bindEvents() { 1129 window.addEventListener('resize', this, { passive: true, capture: false }); 1130 window.addEventListener('scroll', this, { passive: true, capture: false }); 1131 1132 this.sidebar.addEventListener('update' + EVENT_KEY, this); 1133 1134 if (this.options.resizeSensor && 'undefined' !== typeof ResizeSensor) { 1135 new ResizeSensor(this.sidebarInner, this.handleEvent); 1136 new ResizeSensor(this.container, this.handleEvent); 1137 } 1138 } 1139 }, { 1140 key: 'handleEvent', 1141 value: function handleEvent(event) { 1142 this.updateSticky(event); 1143 } 1144 }, { 1145 key: 'calcDimensions', 1146 value: function calcDimensions() { 1147 if (this._breakpoint) return; 1148 var dims = this.dimensions; 1149 1150 // Container of sticky sidebar dimensions. 1151 dims.containerTop = StickySidebar.offsetRelative(this.container).top; 1152 dims.containerHeight = this.container.clientHeight; 1153 dims.containerBottom = dims.containerTop + dims.containerHeight; 1154 1155 // Sidebar dimensions. 1156 dims.sidebarHeight = this.sidebarInner.offsetHeight; 1157 dims.sidebarWidth = this.sidebarInner.offsetWidth; 1158 1159 // Screen viewport dimensions. 1160 dims.viewportHeight = window.innerHeight; 1161 1162 // Maximum sidebar translate Y. 1163 dims.maxTranslateY = dims.containerHeight - dims.sidebarHeight; 1164 1165 this._calcDimensionsWithScroll(); 1166 } 1167 }, { 1168 key: '_calcDimensionsWithScroll', 1169 value: function _calcDimensionsWithScroll() { 1170 var dims = this.dimensions; 1171 1172 dims.sidebarLeft = StickySidebar.offsetRelative(this.sidebar).left; 1173 1174 dims.viewportTop = document.documentElement.scrollTop || document.body.scrollTop; 1175 dims.viewportBottom = dims.viewportTop + dims.viewportHeight; 1176 dims.viewportLeft = document.documentElement.scrollLeft || document.body.scrollLeft; 1177 1178 dims.topSpacing = this.options.topSpacing; 1179 dims.bottomSpacing = this.options.bottomSpacing; 1180 1181 if ('function' === typeof dims.topSpacing) dims.topSpacing = parseInt(dims.topSpacing(this.sidebar)) || 0; 1182 1183 if ('function' === typeof dims.bottomSpacing) dims.bottomSpacing = parseInt(dims.bottomSpacing(this.sidebar)) || 0; 1184 1185 if ('VIEWPORT-TOP' === this.affixedType) { 1186 // Adjust translate Y in the case decrease top spacing value. 1187 if (dims.topSpacing < dims.lastTopSpacing) { 1188 dims.translateY += dims.lastTopSpacing - dims.topSpacing; 1189 this._reStyle = true; 1190 } 1191 } else if ('VIEWPORT-BOTTOM' === this.affixedType) { 1192 // Adjust translate Y in the case decrease bottom spacing value. 1193 if (dims.bottomSpacing < dims.lastBottomSpacing) { 1194 dims.translateY += dims.lastBottomSpacing - dims.bottomSpacing; 1195 this._reStyle = true; 1196 } 1197 } 1198 1199 dims.lastTopSpacing = dims.topSpacing; 1200 dims.lastBottomSpacing = dims.bottomSpacing; 1201 } 1202 }, { 1203 key: 'isSidebarFitsViewport', 1204 value: function isSidebarFitsViewport() { 1205 var dims = this.dimensions; 1206 var offset = this.scrollDirection === 'down' ? dims.lastBottomSpacing : dims.lastTopSpacing; 1207 return this.dimensions.sidebarHeight + offset < this.dimensions.viewportHeight; 1208 } 1209 }, { 1210 key: 'observeScrollDir', 1211 value: function observeScrollDir() { 1212 var dims = this.dimensions; 1213 if (dims.lastViewportTop === dims.viewportTop) return; 1214 1215 var furthest = 'down' === this.direction ? Math.min : Math.max; 1216 1217 // If the browser is scrolling not in the same direction. 1218 if (dims.viewportTop === furthest(dims.viewportTop, dims.lastViewportTop)) this.direction = 'down' === this.direction ? 'up' : 'down'; 1219 } 1220 }, {
vendor: 5,814 bytes, lines 1221-1364
1221 key: 'getAffixType', 1222 value: function getAffixType() { 1223 this._calcDimensionsWithScroll(); 1224 var dims = this.dimensions; 1225 var colliderTop = dims.viewportTop + dims.topSpacing; 1226 var affixType = this.affixedType; 1227 1228 1229 if (colliderTop <= dims.containerTop || dims.containerHeight < dims.sidebarHeight) { 1230 dims.translateY = 0; 1231 affixType = 'STATIC'; 1232 } else { 1233 affixType = 'up' === this.direction ? this._getAffixTypeScrollingUp() : this._getAffixTypeScrollingDown(); 1234 } 1235 1236 // Make sure the translate Y is not bigger than container height. 1237 dims.translateY = Math.max(0, dims.translateY); 1238 dims.translateY = Math.min(dims.containerHeight, dims.translateY); 1239 dims.translateY = Math.round(dims.translateY); 1240 1241 dims.lastViewportTop = dims.viewportTop; 1242 return affixType; 1243 } 1244 }, { 1245 key: '_getAffixTypeScrollingDown', 1246 value: function _getAffixTypeScrollingDown() { 1247 1248 //recalculate when height was changed 1249 if(this.dimensions.containerHeight != this.container.clientHeight){ 1250 this.calcDimensions(); 1251 //console.log('upd'); 1252 } 1253 1254 var dims = this.dimensions; 1255 var sidebarBottom = dims.sidebarHeight + dims.containerTop; 1256 var colliderTop = dims.viewportTop + dims.topSpacing; 1257 var colliderBottom = dims.viewportBottom - dims.bottomSpacing; 1258 var affixType = this.affixedType; 1259 1260 1261 1262 if (this.isSidebarFitsViewport()) { 1263 if (dims.sidebarHeight + colliderTop >= dims.containerBottom) { 1264 dims.translateY = dims.containerBottom - sidebarBottom; 1265 affixType = 'CONTAINER-BOTTOM'; 1266 } else if (colliderTop >= dims.containerTop) { 1267 dims.translateY = colliderTop - dims.containerTop; 1268 affixType = 'VIEWPORT-TOP'; 1269 } 1270 } else { 1271 if (dims.containerBottom <= colliderBottom) { 1272 dims.translateY = dims.containerBottom - sidebarBottom; 1273 affixType = 'CONTAINER-BOTTOM'; 1274 } else if (sidebarBottom + dims.translateY <= colliderBottom) { 1275 dims.translateY = colliderBottom - sidebarBottom; 1276 affixType = 'VIEWPORT-BOTTOM'; 1277 } else if (dims.containerTop + dims.translateY <= colliderTop && 0 !== dims.translateY && dims.maxTranslateY !== dims.translateY) { 1278 affixType = 'VIEWPORT-UNBOTTOM'; 1279 } 1280 } 1281 1282 return affixType; 1283 } 1284 }, { 1285 key: '_getAffixTypeScrollingUp', 1286 value: function _getAffixTypeScrollingUp() { 1287 var dims = this.dimensions; 1288 var sidebarBottom = dims.sidebarHeight + dims.containerTop; 1289 var colliderTop = dims.viewportTop + dims.topSpacing; 1290 var colliderBottom = dims.viewportBottom - dims.bottomSpacing; 1291 var affixType = this.affixedType; 1292 1293 if (colliderTop <= dims.translateY + dims.containerTop) { 1294 dims.translateY = colliderTop - dims.containerTop; 1295 affixType = 'VIEWPORT-TOP'; 1296 } else if (dims.containerBottom <= colliderBottom) { 1297 dims.translateY = dims.containerBottom - sidebarBottom; 1298 affixType = 'CONTAINER-BOTTOM'; 1299 } else if (!this.isSidebarFitsViewport()) { 1300 1301 if (dims.containerTop <= colliderTop && 0 !== dims.translateY && dims.maxTranslateY !== dims.translateY) { 1302 affixType = 'VIEWPORT-UNBOTTOM'; 1303 } 1304 } 1305 1306 return affixType; 1307 } 1308 }, { 1309 key: '_getStyle', 1310 value: function _getStyle(affixType) { 1311 if ('undefined' === typeof affixType) return; 1312 1313 var style = { inner: {}, outer: {} }; 1314 var dims = this.dimensions; 1315 1316 switch (affixType) { 1317 case 'VIEWPORT-TOP': 1318 style.inner = { position: 'fixed', top: dims.topSpacing, 1319 left: dims.sidebarLeft - dims.viewportLeft, width: dims.sidebarWidth }; 1320 break; 1321 case 'VIEWPORT-BOTTOM': 1322 style.inner = { position: 'fixed', top: 'auto', left: dims.sidebarLeft, 1323 bottom: dims.bottomSpacing, width: dims.sidebarWidth }; 1324 break; 1325 case 'CONTAINER-BOTTOM': 1326 case 'VIEWPORT-UNBOTTOM': 1327 var translate = this._getTranslate(0, dims.translateY + 'px'); 1328 1329 if (translate) style.inner = { transform: translate };else style.inner = { position: 'absolute', top: dims.translateY, width: dims.sidebarWidth }; 1330 break; 1331 } 1332 1333 switch (affixType) { 1334 case 'VIEWPORT-TOP': 1335 case 'VIEWPORT-BOTTOM': 1336 case 'VIEWPORT-UNBOTTOM': 1337 case 'CONTAINER-BOTTOM': 1338 style.outer = { height: dims.sidebarHeight, position: 'relative' }; 1339 break; 1340 } 1341 1342 style.outer = StickySidebar.extend({ height: '', position: '' }, style.outer); 1343 style.inner = StickySidebar.extend({ position: 'relative', top: '', left: '', 1344 bottom: '', width: '', transform: '' }, style.inner); 1345 1346 return style; 1347 } 1348 }, { 1349 key: 'stickyPosition', 1350 value: function stickyPosition(force) { 1351 if (this._breakpoint) return; 1352 1353 force = this._reStyle || force || false; 1354 1355 var offsetTop = this.options.topSpacing; 1356 var offsetBottom = this.options.bottomSpacing; 1357 1358 1359 //for actual sidebar height, cause height can change after document load 1360 if(this.sidebarInner.offsetHeight > this.dimensions.sidebarHeight){ 1361 this.dimensions.sidebarHeight = this.sidebarInner.offsetHeight; 1362 } 1363 1364
vendor: 5,484 bytes, lines 1365-1496
1365 var affixType = this.getAffixType(); 1366 var style = this._getStyle(affixType); 1367 1368 if ((this.affixedType != affixType || force) && affixType) { 1369 var affixEvent = 'affix.' + affixType.toLowerCase().replace('viewport-', '') + EVENT_KEY; 1370 StickySidebar.eventTrigger(this.sidebar, affixEvent); 1371 1372 if ('STATIC' === affixType) StickySidebar.removeClass(this.sidebar, this.options.stickyClass);else StickySidebar.addClass(this.sidebar, this.options.stickyClass); 1373 1374 for (var key in style.outer) { 1375 var unit = 'number' === typeof style.outer[key] ? 'px' : ''; 1376 this.sidebar.style[key] = style.outer[key] + unit; 1377 } 1378 1379 for (var _key in style.inner) { 1380 var _unit = 'number' === typeof style.inner[_key] ? 'px' : ''; 1381 this.sidebarInner.style[_key] = style.inner[_key] + _unit; 1382 } 1383 1384 var affixedEvent = 'affixed.' + affixType.toLowerCase().replace('viewport-', '') + EVENT_KEY; 1385 StickySidebar.eventTrigger(this.sidebar, affixedEvent); 1386 } else { 1387 if (this._initialized) this.sidebarInner.style.left = style.inner.left; 1388 } 1389 1390 this.affixedType = affixType; 1391 } 1392 }, { 1393 key: '_widthBreakpoint', 1394 value: function _widthBreakpoint() { 1395 1396 if (window.innerWidth <= this.options.minWidth) { 1397 this._breakpoint = true; 1398 this.affixedType = 'STATIC'; 1399 1400 this.sidebar.removeAttribute('style'); 1401 StickySidebar.removeClass(this.sidebar, this.options.stickyClass); 1402 this.sidebarInner.removeAttribute('style'); 1403 } else { 1404 this._breakpoint = false; 1405 } 1406 } 1407 }, { 1408 key: 'updateSticky', 1409 value: function updateSticky() { 1410 var _this3 = this; 1411 1412 var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 1413 1414 if (this._running) return; 1415 this._running = true; 1416 1417 (function (eventType) { 1418 requestAnimationFrame(function () { 1419 switch (eventType) { 1420 // When browser is scrolling and re-calculate just dimensions 1421 // within scroll. 1422 case 'scroll': 1423 _this3._calcDimensionsWithScroll(); 1424 _this3.observeScrollDir(); 1425 _this3.stickyPosition(); 1426 break; 1427 1428 // When browser is resizing or there's no event, observe width 1429 // breakpoint and re-calculate dimensions. 1430 case 'resize': 1431 default: 1432 _this3._widthBreakpoint(); 1433 _this3.calcDimensions(); 1434 _this3.stickyPosition(true); 1435 break; 1436 } 1437 _this3._running = false; 1438 }); 1439 })(event.type); 1440 } 1441 }, { 1442 key: '_setSupportFeatures', 1443 value: function _setSupportFeatures() { 1444 var support = this.support; 1445 1446 support.transform = StickySidebar.supportTransform(); 1447 support.transform3d = StickySidebar.supportTransform(true); 1448 } 1449 }, { 1450 key: '_getTranslate', 1451 value: function _getTranslate() { 1452 var y = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; 1453 var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 1454 var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; 1455 1456 if (this.support.transform3d) return 'translate3d(' + y + ', ' + x + ', ' + z + ')';else if (this.support.translate) return 'translate(' + y + ', ' + x + ')';else return false; 1457 } 1458 }, { 1459 key: 'destroy', 1460 value: function destroy() { 1461 window.removeEventListener('resize', this, { capture: false }); 1462 window.removeEventListener('scroll', this, { capture: false }); 1463 1464 this.sidebar.classList.remove(this.options.stickyClass); 1465 this.sidebar.style.minHeight = ''; 1466 1467 this.sidebar.removeEventListener('update' + EVENT_KEY, this); 1468 1469 var styleReset = { inner: {}, outer: {} }; 1470 1471 styleReset.inner = { position: '', top: '', left: '', bottom: '', width: '', transform: '' }; 1472 styleReset.outer = { height: '', position: '' }; 1473 1474 for (var key in styleReset.outer) { 1475 this.sidebar.style[key] = styleReset.outer[key]; 1476 }for (var _key2 in styleReset.inner) { 1477 this.sidebarInner.style[_key2] = styleReset.inner[_key2]; 1478 }if (this.options.resizeSensor && 'undefined' !== typeof ResizeSensor) { 1479 ResizeSensor.detach(this.sidebarInner, this.handleEvent); 1480 ResizeSensor.detach(this.container, this.handleEvent); 1481 } 1482 } 1483 }], [{ 1484 key: 'supportTransform', 1485 value: function supportTransform(transform3d) { 1486 var result = false, 1487 property = transform3d ? 'perspective' : 'transform', 1488 upper = property.charAt(0).toUpperCase() + property.slice(1), 1489 prefixes = ['Webkit', 'Moz', 'O', 'ms'], 1490 support = document.createElement('support'), 1491 style = support.style; 1492 1493 (property + ' ' + prefixes.join(upper + ' ') + upper).split(' ').forEach(function (property, i) { 1494 if (style[property] !== undefined) { 1495 result = property; 1496 return false;
1497 } 1498 }); 1499 return result; 1500 } 1501 }, { 1502 key: 'eventTrigger', 1503 value: function eventTrigger(element, eventName, data) { 1504 try { 1505 var event = new CustomEvent(eventName, { detail: data }); 1506 } catch (e) { 1507 var event = document.createEvent('CustomEvent'); 1508 event.initCustomEvent(eventName, true, true, data); 1509 } 1510 element.dispatchEvent(event); 1511 } 1512 }, { 1513 key: 'extend', 1514 value: function extend(defaults, options) { 1515 var results = {}; 1516 for (var key in defaults) { 1517 if ('undefined' !== typeof options[key]) results[key] = options[key];else results[key] = defaults[key]; 1518 } 1519 return results; 1520 } 1521 }, { 1522 key: 'offsetRelative', 1523 value: function offsetRelative(element) { 1524 var result = { left: 0, top: 0 }; 1525 1526 do { 1527 var offsetTop = element.offsetTop; 1528 var offsetLeft = element.offsetLeft; 1529 1530 if (!isNaN(offsetTop)) result.top += offsetTop; 1531 1532 if (!isNaN(offsetLeft)) result.left += offsetLeft; 1533 1534 element = 'BODY' === element.tagName ? element.parentElement : element.offsetParent; 1535 } while (element); 1536 return result; 1537 } 1538 }, { 1539 key: 'addClass', 1540 value: function addClass(element, className) { 1541 if (!StickySidebar.hasClass(element, className)) { 1542 if (element.classList) element.classList.add(className);else element.className += ' ' + className; 1543 } 1544 } 1545 }, { 1546 key: 'removeClass', 1547 value: function removeClass(element, className) { 1548 if (StickySidebar.hasClass(element, className)) { 1549 if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); 1550 } 1551 } 1552 }, { 1553 key: 'hasClass', 1554 value: function hasClass(element, className) { 1555 if (element.classList) return element.classList.contains(className);else return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className); 1556 } 1557 }, { 1558 key: 'defaults', 1559 get: function () { 1560 return DEFAULTS; 1561 } 1562 }]); 1563 1564 return StickySidebar; 1565 }(); 1566 1567 return StickySidebar; 1568 }(); 1569 1570 exports.default = StickySidebar; 1571 1572 1573 // Global 1574 // ------------------------- 1575 window.StickySidebar = StickySidebar; 1576}); 1577}); 1578 1579var stickySidebar$1 = unwrapExports(stickySidebar); 1580 1581exports['default'] = stickySidebar$1; 1582exports.__moduleExports = stickySidebar; 1583 1584Object.defineProperty(exports, '__esModule', { value: true }); 1585 1586}))); 1587/* End */ 1588; 1589; /* Start:"a:4:{s:4:"full";s:68:"/bitrix/templates/aspro_max/js/jquery.alphanumeric.js?15941159261972";s:6:"source";s:53:"/bitrix/templates/aspro_max/js/jquery.alphanumeric.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 1590(function ($) { 1591 $.fn.alphanumeric = function (p) { 1592 var input = $(this), 1593 az = "abcdefghijklmnopqrstuvwxyz", 1594 options = $.extend({ 1595 ichars: '!@#$%^&*()+=[]\\\';,/{}|":<>?~`.- _', 1596 nchars: '', 1597 allow: '' 1598 }, p), 1599 s = options.allow.split(''), 1600 i = 0, 1601 ch, 1602 regex; 1603 1604 for (i; i < s.length; i++) { 1605 if (options.ichars.indexOf(s[i]) != -1) { 1606 s[i] = '\\' + s[i]; 1607 } 1608 } 1609 1610 if (options.nocaps) { 1611 options.nchars += az.toUpperCase(); 1612 } 1613 if (options.allcaps) { 1614 options.nchars += az; 1615 } 1616 1617 options.allow = s.join('|'); 1618 1619 regex = new RegExp(options.allow, 'gi'); 1620 ch = (options.ichars + options.nchars).replace(regex, ''); 1621 1622 input.keypress(function (e) { 1623 var key = String.fromCharCode(!e.charCode ? e.which : e.charCode); 1624 1625 if (ch.indexOf(key) != -1 && !e.ctrlKey) { 1626 e.preventDefault(); 1627 } 1628 }); 1629 1630 input.blur(function () { 1631 var value = input.val(), 1632 j = 0; 1633 1634 for (j; j < value.length; j++) { 1635 if (ch.indexOf(value[j]) != -1) { 1636 input.val(''); 1637 return false; 1638 } 1639 } 1640 return false; 1641 }); 1642 1643 return input; 1644 }; 1645 1646 $.fn.numeric = function (p) { 1647 var az = 'abcdefghijklmnopqrstuvwxyz', 1648 aZ = az.toUpperCase(); 1649 1650 return this.each(function () {
1651 $(this).alphanumeric($.extend({ nchars: az + aZ }, p)); 1652 }); 1653 }; 1654 1655 $.fn.alpha = function (p) { 1656 var nm = '1234567890'; 1657 return this.each(function () { 1658 $(this).alphanumeric($.extend({ nchars: nm }, p)); 1659 }); 1660 }; 1661})(jQuery); 1662/* End */ 1663; 1664; /* Start:"a:4:{s:4:"full";s:62:"/bitrix/templates/aspro_max/js/jquery.cookie.js?15941159263066";s:6:"source";s:47:"/bitrix/templates/aspro_max/js/jquery.cookie.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 1665/*! 1666 * jQuery Cookie Plugin v1.4.0 1667 * https://github.com/carhartl/jquery-cookie 1668 * 1669 * Copyright 2013 Klaus Hartl 1670 * Released under the MIT license 1671 */ 1672(function (factory) { 1673 if (typeof define === 'function' && define.amd) { 1674 // AMD. Register as anonymous module. 1675 define(['jquery'], factory); 1676 } else { 1677 // Browser globals. 1678 factory(jQuery); 1679 } 1680}(function ($) { 1681 1682 var pluses = /\+/g; 1683 1684 function encode(s) { 1685 return config.raw ? s : encodeURIComponent(s); 1686 } 1687 1688 function decode(s) { 1689 return config.raw ? s : decodeURIComponent(s); 1690 } 1691 1692 function stringifyCookieValue(value) { 1693 return encode(config.json ? JSON.stringify(value) : String(value)); 1694 } 1695 1696 function parseCookieValue(s) { 1697 if (s.indexOf('"') === 0) { 1698 // This is a quoted cookie as according to RFC2068, unescape... 1699 s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 1700 } 1701 1702 try { 1703 // Replace server-side written pluses with spaces. 1704 // If we can't decode the cookie, ignore it, it's unusable. 1705 // If we can't parse the cookie, ignore it, it's unusable. 1706 s = decodeURIComponent(s.replace(pluses, ' ')); 1707 return config.json ? JSON.parse(s) : s; 1708 } catch(e) {} 1709 } 1710 1711 function read(s, converter) { 1712 var value = config.raw ? s : parseCookieValue(s); 1713 return $.isFunction(converter) ? converter(value) : value; 1714 } 1715 1716 var config = $.cookie = function (key, value, options) { 1717 1718 // Write 1719 1720 if (value !== undefined && !$.isFunction(value)) { 1721 options = $.extend({}, config.defaults, options); 1722 1723 if (typeof options.expires === 'number') { 1724 var days = options.expires, t = options.expires = new Date(); 1725 t.setTime(+t + days * 864e+5); 1726 } 1727 1728 return (document.cookie = [ 1729 encode(key), '=', stringifyCookieValue(value), 1730 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 1731 options.path ? '; path=' + options.path : '', 1732 options.domain ? '; domain=' + options.domain : '', 1733 options.secure ? '; secure' : '' 1734 ].join('')); 1735 } 1736 1737 // Read 1738 1739 var result = key ? undefined : {}; 1740 1741 // To prevent the for loop in the first place assign an empty array 1742 // in case there are no cookies at all. Also prevents odd result when 1743 // calling $.cookie(). 1744 var cookies = document.cookie ? document.cookie.split('; ') : []; 1745 1746 for (var i = 0, l = cookies.length; i < l; i++) { 1747 var parts = cookies[i].split('='); 1748 var name = decode(parts.shift()); 1749 var cookie = parts.join('='); 1750 1751 if (key && key === name) { 1752 // If second argument (value) is a function it's a converter... 1753 result = read(cookie, value); 1754 break; 1755 } 1756 1757 // Prevent storing a cookie that we couldn't decode. 1758 if (!key && (cookie = read(cookie)) !== undefined) { 1759 result[name] = cookie; 1760 } 1761 } 1762 1763 return result; 1764 }; 1765 1766 config.defaults = {}; 1767 1768 $.removeCookie = function (key, options) { 1769 if ($.cookie(key) === undefined) { 1770 return false; 1771 } 1772 1773 // Must not alter options, thus extending a fresh object... 1774 $.cookie(key, '', $.extend({}, options, { expires: -1 })); 1775 return !$.cookie(key); 1776 }; 1777 1778})); 1779 1780/* End */ 1781; 1782; /* Start:"a:4:{s:4:"full";s:56:"/bitrix/templates/aspro_max/js/mobile.js?175076299528083";s:6:"source";s:40:"/bitrix/templates/aspro_max/js/mobile.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 1783$(document).ready(function () { 1784 /* --- Bind mobile menu --- */ 1785 var $mobileMenu = $("#mobilemenu"); 1786 if ($mobileMenu.length) { 1787 $mobileMenu.isLeftSide = $mobileMenu.hasClass("leftside"); 1788 $mobileMenu.isOpen = $mobileMenu.hasClass("show"); 1789 $mobileMenu.isDowndrop = $mobileMenu.find(">.scroller").hasClass("downdrop"); 1790 $mobileMenuNlo = $mobileMenu.find("[data-nlo]"); 1791 1792 $("#mobileheader .burger").click(function () { 1793 SwipeMobileMenu(); 1794 1795 // Closing hint list of items after the burger icon clicked 1796 if (typeof jsControlMobile === "object" && jsControlMobile && "onFocusLost" in jsControlMobile) { 1797 jsControlMobile.onFocusLost(); 1798 } 1799 }); 1800 1801 if ($mobileMenu.isLeftSide) { 1802 $mobileMenu.parent().append('<div id="mobilemenu-overlay"></div>'); 1803 var $mobileMenuOverlay = $("#mobilemenu-overlay"); 1804 1805 $mobileMenuOverlay.click(function () { 1806 if ($mobileMenu.isOpen) { 1807 CloseMobileMenu(); 1808 $mobileMenu.find('.expanded').removeClass("expanded"); 1809 } 1810 }); 1811 BX.loadScript(arAsproOptions.SITE_TEMPLATE_PATH + "/js/jquery.mobile.custom.touch.min.js", function () { 1812 $(document).swiperight(function (e) { 1813 if ( 1814 !$(e.target).closest(".flexslider").length && 1815 !$(e.target).closest(".swipeignore").length && 1816 !$(e.target).closest(".mobile-scrolled").length &&
1817 !$(e.target).closest(".jqmWindow.popup").length 1818 ) { 1819 var partWindowWidth = document.documentElement.clientWidth / 3; 1820 var swipeStart = e.swipestart.coords[0]; 1821 if (swipeStart <= partWindowWidth) { 1822 OpenMobileMenu(); 1823 } 1824 } 1825 }); 1826 1827 $(document).swipeleft(function (e) { 1828 if ( 1829 !$(e.target).closest(".flexslider").length && 1830 !$(e.target).closest(".swipeignore").length && 1831 !$(e.target).closest(".mobile-scrolled").length && 1832 !$(e.target).closest(".jqmWindow.popup").length 1833 ) { 1834 CloseMobileMenu(); 1835 } 1836 }); 1837 }) 1838 } else { 1839 $(document).on("click", "#mobileheader", function (e) { 1840 if ( 1841 !$(e.target).closest("#mobilemenu").length && 1842 !$(e.target).closest(".burger").length && 1843 $mobileMenu.isOpen 1844 ) { 1845 CloseMobileMenu(); 1846 } 1847 }); 1848 } 1849 1850 $(document).on("click", "#mobilemenu .menu a,#mobilemenu .social-icons a", function (e) { 1851 var $this = $(this); 1852 if ($this.hasClass("parent")) { 1853 e.preventDefault(); 1854 1855 if (!$mobileMenu.isDowndrop) { 1856 $this.closest("li").addClass("expanded"); 1857 MoveMobileMenuWrapNext(); 1858 } else { 1859 if (!$this.closest("li").hasClass("expanded")) { 1860 $this.closest("li").addClass("expanded"); 1861 } else { 1862 $this.closest("li").removeClass("expanded"); 1863 } 1864 1865 initMobileRegions(); 1866 } 1867 } else { 1868 if ($this.closest("li").hasClass("counters")) { 1869 var href = $this.attr("href"); 1870 if (typeof href !== "undefined") { 1871 if (href !== "javascript:void(0)") { 1872 window.location.href = href; 1873 window.location.reload(); 1874 } else { 1875 return 1876 } 1877 } 1878 } 1879 1880 if (!$this.closest(".menu_back").length) { 1881 CloseMobileMenu(); 1882 } 1883 } 1884 }); 1885 1886 $(document).on("click", "#mobilemenu .dropdown .menu_back", function (e) { 1887 e.preventDefault(); 1888 var $this = $(this); 1889 1890 MoveMobileMenuWrapPrev(); 1891 1892 setTimeout(function () { 1893 $this.closest(".expanded").removeClass("expanded"); 1894 }, 400); 1895 }); 1896 1897 $(document).on('click', '#mobilemenu .menu.mobile_regions .menu_autocomplete .clean_icon', function (e) { 1898 $(this).closest('.wrapper').find('input[type=text]').val('').trigger('change'); 1899 $(this).hide(); 1900 }); 1901 1902 $(document).on('keyup change paste', '#mobilemenu .menu.mobile_regions .menu_autocomplete input[type=text]', function (e) { 1903 let $btn = $(this).closest('.wrapper').find('.clean_icon'); 1904 1905 if ($(this).val().length) { 1906 $btn.show(); 1907 } 1908 else { 1909 $btn.hide(); 1910 1911 // hide finded cities 1912 $(this).closest('.dropdown').find('.mobile-cities').show().siblings().hide().empty(); 1913 } 1914 }); 1915 1916 $(document).on("click", ".mobile_regions .mobile-city a", function (e) { 1917 e.preventDefault(); 1918 1919 let $this = $(this); 1920 let regionId = $this.data("id"); 1921 1922 if (regionId) { 1923 setCookieOnDomains('current_region', regionId); 1924 1925 let locationId = $this.data("locid"); 1926 if (locationId) { 1927 setCookieOnDomains('current_location', locationId); 1928 } else { 1929 setCookieOnDomains('current_location', '', {expires: -1}); 1930 } 1931 1932 let href = $this.attr("href"); 1933 location.href = href; 1934 } 1935 }); 1936 1937 function OpenMobileMenu() { 1938 CloseMobilePhone(); 1939 1940 if (!$mobileMenu.isOpen) { 1941 // hide styleswitcher 1942 if ($(".style-switcher").hasClass("active")) { 1943 $(".style-switcher .switch").trigger("click"); 1944 } 1945 $(".style-switcher .switch").hide(); 1946 1947 if ($mobileMenu.isLeftSide) { 1948 // show overlay 1949 setTimeout(function () { 1950 $mobileMenuOverlay.fadeIn("fast"); 1951 }, 100); 1952 } else { 1953 // scroll body to top & set fixed 1954 $("body").scrollTop(0).css({ position: "fixed" }); 1955 1956 // set menu top = bottom of header 1957 $mobileMenu.css({ top: +($("#mobileheader").height() + $("#mobileheader").offset().top) + "px" }); 1958 1959 // change burger icon 1960 $("#mobileheader .burger").addClass("c"); 1961 } 1962 1963 // show menu 1964 $mobileMenu.addClass("show"); 1965 $mobileMenu.isOpen = true; 1966 1967 if (!$mobileMenu.isDowndrop) { 1968 var $wrap = $mobileMenu.find(".wrap").first(); 1969 var params = $wrap.data("params"); 1970 if (typeof params === "undefined") { 1971 params = { 1972 depth: 0, 1973 scroll: {}, 1974 height: {}, 1975 }; 1976 } 1977 $wrap.data("params", params); 1978 } 1979 1980 if ($mobileMenuNlo.length) { 1981 if (!$mobileMenuNlo.hasClass("nlo-loadings")) { 1982 $mobileMenuNlo.addClass("nlo-loadings"); 1983 setTimeout(function () { 1984 $.ajax({ 1985 data: { nlo: $mobileMenuNlo.attr("data-nlo") }, 1986 success: function (response) { 1987 $mobileMenuNlo[0].insertAdjacentHTML("beforebegin", $.trim(response)); 1988 $mobileMenuNlo.remove(); 1989 }, 1990 error: function () { 1991 $mobileMenuNlo.removeClass("nlo-loadings"); 1992 }, 1993 }); 1994 }, 300); 1995 } 1996 } 1997 } 1998 } 1999 2000 function CloseMobileMenu() { 2001 if ($mobileMenu.isOpen) { 2002 // hide menu 2003 $mobileMenu.removeClass("show"); 2004 $mobileMenu.isOpen = false;
2005 2006 // show styleswitcher 2007 $(".style-switcher .switch").show(); 2008 2009 if ($mobileMenu.isLeftSide) { 2010 // hide overlay 2011 setTimeout(function () { 2012 $mobileMenuOverlay.fadeOut("fast"); 2013 }, 100); 2014 } else { 2015 // change burger icon 2016 $("#mobileheader .burger").removeClass("c"); 2017 2018 // body unset fixed 2019 $("body").css({ position: "" }); 2020 } 2021 2022 if (!$mobileMenu.isDowndrop) { 2023 setTimeout(function () { 2024 var $scroller = $mobileMenu.find(".scroller").first(); 2025 var $wrap = $mobileMenu.find(".wrap").first(); 2026 var params = $wrap.data("params"); 2027 params.depth = 0; 2028 $wrap.data("params", params).attr("style", ""); 2029 $mobileMenu.scrollTop(0); 2030 $scroller.css("height", ""); 2031 }, 400); 2032 } 2033 } 2034 } 2035 2036 function SwipeMobileMenu() { 2037 if ($mobileMenu.isOpen) { 2038 CloseMobileMenu(); 2039 } else { 2040 OpenMobileMenu(); 2041 } 2042 } 2043 2044 function MoveMobileMenuWrapNext() { 2045 if (!$mobileMenu.isDowndrop) { 2046 var $scroller = $mobileMenu.find(".scroller").first(); 2047 var $wrap = $mobileMenu.find(".wrap").first(); 2048 if ($wrap.length) { 2049 var params = $wrap.data("params"); 2050 var $dropdownNext = $mobileMenu.find(".expanded>.dropdown").eq(params.depth); 2051 if ($dropdownNext.length) { 2052 var bMobileRegions = $dropdownNext.closest('.mobile_regions').length; 2053 if (bMobileRegions) { 2054 var $fixedCities = $dropdownNext.find('.menu-item-fixed'); 2055 } 2056 2057 // save scroll position 2058 params.scroll[params.depth] = parseInt($mobileMenu.scrollTop()); 2059 2060 // height while move animating 2061 params.height[params.depth + 1] = Math.max( 2062 $dropdownNext.height(), 2063 !params.depth 2064 ? $wrap.height() 2065 : $mobileMenu 2066 .find(".expanded>.dropdown") 2067 .eq(params.depth - 1) 2068 .height() 2069 ); 2070 $scroller.css("height", params.height[params.depth + 1] + "px"); 2071 2072 // inc depth 2073 ++params.depth; 2074 2075 // translateX for move 2076 $wrap.css("transform", "translateX(" + -100 * params.depth + "%)"); 2077 2078 // scroll to top 2079 setTimeout(function () { 2080 $mobileMenu.animate({ scrollTop: 0 }, 200); 2081 }, 100); 2082 2083 if (bMobileRegions) { 2084 $fixedCities.css('height', ($mobileMenu.height() - $fixedCities.position().top) + 'px'); 2085 } 2086 2087 // height on enimating end 2088 var h = $dropdownNext.height(); 2089 setTimeout(function () { 2090 if (h) { 2091 $scroller.css("height", h + "px"); 2092 } else { 2093 $scroller.css("height", ""); 2094 } 2095 2096 if (bMobileRegions) { 2097 setTimeout(function () { 2098 // show cities scroll 2099 $fixedCities.css('overflow', ''); 2100 }, 200); 2101 2102 initMobileRegions(); 2103 } 2104 }, 200); 2105 } 2106 2107 $wrap.data("params", params); 2108 } 2109 } 2110 } 2111 2112 function MoveMobileMenuWrapPrev() { 2113 if (!$mobileMenu.isDowndrop) { 2114 var $scroller = $mobileMenu.find(".scroller").first(); 2115 var $wrap = $mobileMenu.find(".wrap").first(); 2116 if ($wrap.length) { 2117 var params = $wrap.data("params"); 2118 if (params.depth > 0) { 2119 var $dropdown = $mobileMenu.find(".expanded>.dropdown").eq(params.depth - 1); 2120 if ($dropdown.length) { 2121 // height while move animating 2122 $scroller.css("height", params.height[params.depth] + "px"); 2123 2124 // dec depth 2125 --params.depth; 2126 2127 // translateX for move 2128 $wrap.css("transform", "translateX(" + -100 * params.depth + "%)"); 2129 2130 // restore scroll position 2131 setTimeout(function () { 2132 $mobileMenu.animate({ scrollTop: params.scroll[params.depth] }, 200); 2133 }, 100); 2134 2135 if ($dropdown.closest('.mobile_regions').length) { 2136 // hide cities scroll 2137 $dropdown.find('.menu-item-fixed').css('overflow', 'hidden'); 2138 2139 // scroll cities to top 2140 setTimeout(function () { 2141 $dropdown.find('.menu-item-fixed').animate({ scrollTop: 0 }, 200); 2142 }, 100); 2143 } 2144 2145 // height on enimating end 2146 var h = !params.depth 2147 ? false 2148 : $mobileMenu 2149 .find(".expanded>.dropdown") 2150 .eq(params.depth - 1) 2151 .height(); 2152 setTimeout(function () { 2153 if (h) { 2154 $scroller.css("height", h + "px"); 2155 } else { 2156 $scroller.css("height", ""); 2157 } 2158 }, 200); 2159 } 2160 } 2161 2162 $wrap.data("params", params); 2163 } 2164 } 2165 } 2166 2167 function initMobileRegions() { 2168 if (!initMobileRegions.inited) { 2169 initMobileRegions.inited = true; 2170 2171 if ($('.mobile_regions .dropdown .loadings').length) { 2172 getMainCities(); 2173 } 2174 2175 BX.loadScript(arAsproOptions.SITE_TEMPLATE_PATH + '/js/jquery-ui.min.js', autocompleteMobileRegionsHandler); 2176 } 2177 } 2178 2179 initMobileRegions.inited = false;
2180 2181 function autocompleteMobileRegionsHandler(){ 2182 $("#mobile-region-search").autocomplete({ 2183 minLength: 2, 2184 appendTo : $('.mobile_regions .dropdown .mobile-cities').closest('.menu-item-fixed'), 2185 source: function(request, callback){ 2186 let componentAction = 'searchCities'; 2187 let componentName = 'aspro:regionality.list.max'; 2188 let sessid = BX.message('bitrix_sessid'); 2189 let lang = BX.message('LANGUAGE_ID'); 2190 let siteId = BX.message('SITE_ID'); 2191 let url = location.pathname + location.search; 2192 2193 BX.ajax({ 2194 url: '/bitrix/services/main/ajax.php?mode=ajax&c=' + encodeURIComponent(componentName) +'&action=' + componentAction + '&sessid=' + sessid + '&SITE_ID=' + siteId + '&siteId=' + siteId + '&url=' + encodeURIComponent(url) + '&term=' + encodeURIComponent(request.term) + '&lang=' + lang, 2195 method: 'POST', 2196 async: true, 2197 processData: true, 2198 scriptsRunFirst: true, 2199 emulateOnload: true, 2200 start: true, 2201 cache: false, 2202 dataType: 'json', 2203 onsuccess: function(response){ 2204 if ( 2205 typeof response === 'object' && 2206 response && 2207 typeof response.data === 'object' && 2208 response.data 2209 ) { 2210 if (Object.values(response.data.cities).length) { 2211 callback(response.data.cities); 2212 } 2213 else { 2214 $('.mobile_regions .dropdown .mobile-cities').hide().siblings().empty().show(); 2215 } 2216 } 2217 }, 2218 onfailure: function(){ 2219 } 2220 }); 2221 }, 2222 select: function(event, ui) { 2223 let regionId = ui.item.ID; 2224 if (regionId) { 2225 setCookieOnDomains('current_region', regionId); 2226 2227 let locationId = ui.item.LOCATION_ID; 2228 if (locationId) { 2229 setCookieOnDomains('current_location', locationId); 2230 } 2231 else { 2232 setCookieOnDomains('current_location', '', {expires: -1}); 2233 } 2234 } 2235 2236 $('#mobile-region-search').val(ui.item.label); 2237 2238 return false; 2239 }, 2240 open: function(event, ui) { 2241 $('.mobile_regions .dropdown .mobile-cities').hide().siblings().show(); 2242 }, 2243 close: function(event, ui) { 2244 // do not hide finded citties! Hide it only on empty phrase! 2245 $('.mobile_regions .dropdown .mobile-cities').siblings().show(); 2246 } 2247 }).data('ui-autocomplete')._renderItem = function(ul, item){ 2248 let html = ` 2249 <li class="mobile-city"> 2250 <a href="` + item.URL + `" data-id="` + item.ID + `" data-locid="` + (item.LOCATION_ID ? item.LOCATION_ID : '') + `" class="dark-color"><span>` + item.NAME + `</span>` + (item.PATH ? '<div class="muted">' + item.PATH + '</div>' : '') + `</a> 2251 </li> 2252 `; 2253 2254 return $(html).appendTo(ul); 2255 } 2256 } 2257 2258 function getMainCities() { 2259 let componentAction = 'getMainCities'; 2260 let componentName = 'aspro:regionality.list.max'; 2261 let sessid = BX.message('bitrix_sessid'); 2262 let lang = BX.message('LANGUAGE_ID'); 2263 let siteId = BX.message('SITE_ID'); 2264 let url = location.pathname + location.search; 2265 let lastId = getMainCities.lastId; 2266 let $loadings = $('.mobile_regions .dropdown .loadings').closest('li'); 2267 2268 BX.ajax({ 2269 url: '/bitrix/services/main/ajax.php?mode=ajax&c=' + encodeURIComponent(componentName) +'&action=' + componentAction + '&sessid=' + sessid + '&SITE_ID=' + siteId + '&siteId=' + siteId + '&url=' + encodeURIComponent(url) + '&lastId=' + lastId + '&lang=' + lang, 2270 method: 'POST', 2271 async: true, 2272 processData: true, 2273 scriptsRunFirst: true, 2274 emulateOnload: true, 2275 start: true, 2276 cache: false, 2277 dataType: 'json', 2278 onsuccess: function(response){ 2279 if ( 2280 typeof response === 'object' && 2281 response && 2282 typeof response.data === 'object' && 2283 response.data 2284 ) { 2285 if (typeof response.data.lastId !== 'undefined') { 2286 getMainCities.lastId = response.data.lastId; 2287 } 2288 2289 if ( 2290 response.data.cities && 2291 Object.values(response.data.cities).length 2292 ) { 2293 let itemsHtml = ''; 2294 2295 for (let i in response.data.cities) { 2296 let item = response.data.cities[i]; 2297 let bCurrent = item.CURRENT == 1; 2298 2299 itemsHtml += ` 2300 <li class="mobile-city main-city` + (bCurrent ? ' selected' : '') + `"> 2301 <a href="` + item.URL + `" data-id="` + item.ID + `" data-locid="` + (item.LOCATION_ID ? item.LOCATION_ID : '') + `" class="dark-color"><span>` + item.NAME + `</span>` + (item.PATH ? '<div class="muted">' + item.PATH + '</div>' : '') + `</a> 2302 </li> 2303 `; 2304 } 2305 2306 $(itemsHtml).insertBefore($loadings); 2307 2308 if (response.data.more) { 2309 getMainCities.observer.observe($loadings[0]); 2310 } 2311 else { 2312 $loadings.remove(); 2313 } 2314 } 2315 } 2316 }, 2317 onfailure: function(){ 2318 $loadings.remove(); 2319 } 2320 }); 2321 } 2322 2323 getMainCities.lastId = 0; 2324 getMainCities.observer = new IntersectionObserver((entries, observer) => {
2325 entries.forEach(entry => { 2326 if (entry.isIntersecting) { 2327 getMainCities.observer.unobserve(entry.target); 2328 getMainCities(); 2329 } 2330 }) 2331 }, { 2332 root: null, 2333 rootMargin: '0px', 2334 threshold: 0.5, 2335 }); 2336 } 2337 /* --- END Bind mobile menu --- */ 2338 2339 /* --- Bind mobile phone --- */ 2340 var $mobileHeader = $("#mobileheader"); 2341 var $simpleHeader = $("body.simple_basket_mode #header"); 2342 var $mobilePhone = $("#mobilePhone"); 2343 $mobilePhone.isOpen = false; 2344 if ($mobilePhone.length) { 2345 $mobilePhone.isOpen = $mobilePhone.hasClass("show"); 2346 2347 $(document).on("click", ".wrap_phones .svg-inline-phone", function (e) { 2348 SwipeMobilePhone(); 2349 e.stopPropagation(); 2350 }); 2351 2352 $(document).on("click", ".wrap_phones .svg-inline-close", function (e) { 2353 CloseMobilePhone(); 2354 e.stopPropagation(); 2355 }); 2356 } 2357 2358 SwipeMobilePhone = function () { 2359 if ($mobilePhone.isOpen) { 2360 CloseMobilePhone(); 2361 } else { 2362 OpenMobilePhone(); 2363 } 2364 }; 2365 2366 OpenMobilePhone = function () { 2367 if (!$mobilePhone.isOpen) { 2368 CloseMobileMenu(); 2369 2370 // show overlay 2371 var isSimple = Boolean($simpleHeader.length); 2372 var positionOffset = isSimple 2373 ? $simpleHeader[0].getBoundingClientRect() 2374 : $mobileHeader[0].getBoundingClientRect(); 2375 var position = positionOffset.top + positionOffset.height + pageYOffset; 2376 $('<div class="jqmOverlay mobp" style="top:' + position + 'px;position:absolute"></div>').appendTo("body"); 2377 2378 // toggle phones 2379 setTimeout(function () { 2380 $mobilePhone.slideDown("fast", function () { 2381 $mobilePhone.addClass("show"); 2382 $mobilePhone.isOpen = true; 2383 }); 2384 }, 100); 2385 } 2386 }; 2387 2388 CloseMobilePhone = function () { 2389 if ($mobilePhone.isOpen) { 2390 // toggle phones 2391 setTimeout(function () { 2392 $mobilePhone.slideUp("fast", function () { 2393 $mobilePhone.removeClass("show"); 2394 $mobilePhone.isOpen = false; 2395 2396 // hide overlay 2397 $(".jqmOverlay.mobp").remove(); 2398 }); 2399 }, 100); 2400 } 2401 }; 2402 2403 checkMobilePhone = function () { 2404 if (!window.matchMedia("(max-width: 991px)").matches) { 2405 CloseMobilePhone(); 2406 } 2407 }; 2408 $(document).on("click", "body.simple_basket_mode .back-mobile-arrow .arrow-back", function () { 2409 if (document.referrer && document.referrer != location.href) { 2410 window.history.back(); 2411 } else { 2412 location.href = "/"; 2413 } 2414 }); 2415 /* --- END Bind mobile phone --- */ 2416 2417 /* --- Bind mobile filter --- */ 2418 var $mobilefilter = $("#mobilefilter"); 2419 if ($mobilefilter.length) { 2420 $mobilefilter.isOpen = $mobileMenu.hasClass("show"); 2421 $mobilefilter.isAppendLeft = false; 2422 $mobilefilter.isWrapFilter = false; 2423 $mobilefilter.isHorizontalOrCompact = $(".filter_horizontal").length || $(".bx_filter_vertical.compact").length; 2424 $mobilefilter.close = '<i class="svg svg-close close-icons"></i>'; 2425 2426 $(document).on("click", ".bx-filter-title", function () { 2427 OpenMobileFilter(); 2428 }); 2429 2430 $(document).on("click", "#mobilefilter .svg-close.close-icons", function () { 2431 CloseMobileFilter(); 2432 }); 2433 2434 $(document).on("click", ".bx_filter_select_block", function (e) { 2435 var bx_filter_select_container = $(e.target).parents(".bx_filter_select_container"); 2436 if (bx_filter_select_container.length) { 2437 var prop_id = bx_filter_select_container.closest(".bx_filter_parameters_box").attr("data-property_id"); 2438 if ($("#smartFilterDropDown" + prop_id).length) { 2439 $("#smartFilterDropDown" + prop_id).css({ 2440 "max-width": bx_filter_select_container.width(), 2441 "z-index": "3020", 2442 }); 2443 } 2444 } 2445 }); 2446 2447 $(document).on("mouseup", ".bx_filter_section", function (e) { 2448 if ($(e.target).hasClass("bx_filter_search_button")) { 2449 CloseMobileFilter(); 2450 } 2451 }); 2452 2453 $(document).on("mouseup", ".bx_filter_parameters_box_title", function (e) { 2454 $("[id^='smartFilterDropDown']").hide(); 2455 if ($(e.target).hasClass("close-icons")) { 2456 CloseMobileFilter(); 2457 } 2458 }); 2459 2460 /*$(document).on('DOMSubtreeModified', "#mobilefilter #modef_num_mobile", function() { 2461 mobileFilterNum($(this)); 2462 }); 2463 2464 $(document).on('DOMSubtreeModified', "#mobilefilter .bx_filter_container_modef", function() { 2465 mobileFilterNum($(this)); 2466 });*/ 2467 2468 $mobilefilter.parent().append('<div id="mobilefilter-overlay"></div>'); 2469 var $mobilefilterOverlay = $("#mobilefilter-overlay"); 2470 2471 $mobilefilterOverlay.click(function () { 2472 if ($mobilefilter.isOpen) { 2473 CloseMobileFilter(); 2474 //e.stopPropagation(); 2475 } 2476 }); 2477 2478 mobileFilterNum = function (num, def) { 2479 if (def) { 2480 $(".bx_filter_search_button").text(num.data("f")); 2481 } else { 2482 var str = ""; 2483 var $prosLeng = $(".bx_filter_parameters_box > span"); 2484 2485 str += 2486 $prosLeng.data("f") + 2487 " " + 2488 num + 2489 " " + 2490 declOfNumFilter(num, [$prosLeng.data("fi"), $prosLeng.data("fr"), $prosLeng.data("frm")]); 2491 $(".bx_filter_search_button").text(str); 2492 } 2493 }; 2494 2495 declOfNumFilter = function (number, titles) { 2496 cases = [2, 0, 1, 1, 1, 2]; 2497 return titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[number % 10 < 5 ? number % 10 : 5]]; 2498 }; 2499 2500 OpenMobileFilter = function () { 2501 if (!$mobilefilter.isOpen) { 2502 $("body").addClass("jqm-initied wf"); 2503 2504 $(".bx_filter_vertical .slide-block__head.filter_title").removeClass("closed"); 2505 2506 $(".bx_filter_vertical .slide-block__head.filter_title + .slide-block__body").show(); 2507 2508 if (!$mobilefilter.isAppendLeft) { 2509 if (!$mobilefilter.isWrapFilter) { 2510 $(".bx_filter").wrap("<div id='wrapInlineFilter'></div>"); 2511 $mobilefilter.isWrapFilter = true; 2512 } 2513 $(".bx_filter").appendTo($("#mobilefilter")); 2514 var helper = $("#filter-helper"); 2515 if (helper.length) { 2516 helper.prependTo($("#mobilefilter .bx_filter_parameters")); 2517 } 2518 $mobilefilter.isAppendLeft = true; 2519 } 2520 if (typeof checkFilterLandgings === "function") { 2521 checkFilterLandgings(); 2522 } 2523 2524 $("#mobilefilter .bx_filter_parameters").addClass("scrollbar scrollblock"); 2525 $("#mobilefilter .slide-block .filter_title").addClass("ignore"); 2526 $("#mobilefilter .bx_filter_parameters .bx_filter_parameters_box_title").addClass( 2527 "colored_theme_hover_bg-block" 2528 ); 2529 2530 $(".bx_filter_button_box.ajax-btns").addClass("colored_theme_bg"); 2531 $(".bx_filter_button_box.ajax-btns .filter-bnt-wrapper").removeClass("hidden"); 2532 InitCustomScrollBar(); 2533 2534 // show overlay 2535 setTimeout(function () { 2536 $mobilefilterOverlay.fadeIn("fast"); 2537 }, 100); 2538 2539 // fix body 2540 $("body").css({ overflow: "hidden", height: "100vh" }); 2541 2542 // show mobile filter 2543 $mobilefilter.addClass("show"); 2544 $mobilefilter.find(".bx_filter").css({ display: "block" }); 2545 $mobilefilter.isOpen = true; 2546 2547 $("#mobilefilter .bx_filter_button_box.btns.ajax-btns").removeClass("hidden"); 2548 2549 var init = $mobilefilter.data("init"); 2550 if (typeof init === "undefined") { 2551 $mobilefilter.scroll(function () { 2552 $(".bx_filter_section .bx_filter_select_container").each(function () { 2553 var prop_id = $(this).closest(".bx_filter_parameters_box").attr("data-property_id"); 2554 if ($("#smartFilterDropDown" + prop_id).length) { 2555 $("#smartFilterDropDown" + prop_id).hide(); 2556 } 2557 }); 2558 }); 2559 2560 $mobilefilter.data("init", "Y"); 2561 } 2562 } 2563 }; 2564 2565 CloseMobileFilter = function (append) { 2566 $mobilefilter.find(".bx_filter_parameters").removeClass("scrollbar"); 2567 2568 if ($("#mobilefilter .bx_filter_parameters").length) $("body").removeClass("jqm-initied wf"); 2569 2570 $("#mobilefilter .bx_filter_parameters .bx_filter_parameters_box_title").removeClass( 2571 "colored_theme_hover_bg-block" 2572 ); 2573 $(".slide-block .filter_title").removeClass("ignore"); 2574 $(".bx_filter_button_box.ajax-btns").removeClass("colored_theme_bg"); 2575 2576 $(".bx_filter:not(.n-ajax) .bx_filter_button_box.ajax-btns .filter-bnt-wrapper").addClass("hidden"); 2577 2578 if ($mobilefilter.isOpen) { 2579 // scroll to top 2580 $mobilefilter.find(".bx_filter_parameters").scrollTop(0); 2581 2582 // unfix body 2583 $("body").css({ overflow: "", height: "" }); 2584 2585 // hide overlay 2586 setTimeout(function () { 2587 $mobilefilterOverlay.fadeOut("fast"); 2588 }, 100); 2589 2590 // hide mobile filter 2591 $mobilefilter.removeClass("show"); 2592 $mobilefilter.isOpen = false;
2593 } 2594 2595 if (append && $mobilefilter.isAppendLeft) { 2596 $(".bx_filter").appendTo($("#wrapInlineFilter")).show(); 2597 var helper = $("#filter-helper"); 2598 if (helper.length) { 2599 helper.appendTo($("#filter-helper-wrapper")); 2600 } 2601 $mobilefilter.isAppendLeft = false; 2602 $mobilefilter.removeData("init"); 2603 mobileFilterNum($("#modef_num_mobile"), true); 2604 } 2605 }; 2606 2607 checkMobileFilter = function () { 2608 if ( 2609 (!window.matchMedia("(max-width: 991px)").matches && !$mobilefilter.isHorizontalOrCompact) || 2610 (!window.matchMedia("(max-width: 767px)").matches && $mobilefilter.isHorizontalOrCompact) 2611 ) { 2612 CloseMobileFilter(true); 2613 } 2614 }; 2615 } else { 2616 checkTopFilter(); 2617 $(document).on("click", ".bx-filter-title", function () { 2618 $(this).toggleClass("opened"); 2619 if ($(".visible_mobile_filter").length) { 2620 $(".visible_mobile_filter").show(); 2621 $(".bx_filter_vertical, .bx_filter").slideToggle(333); 2622 } else { 2623 $(".bx_filter_vertical").closest("div[id^=bx_incl]").show(); 2624 $(".bx_filter_vertical, .bx_filter").slideToggle(333); 2625 } 2626 }); 2627 } 2628 /* --- END Bind mobile filter --- */ 2629}); 2630 2631/* End */ 2632; 2633; /* Start:"a:4:{s:4:"full";s:55:"/bitrix/templates/aspro_max/js/main.js?1750763006301154";s:6:"source";s:38:"/bitrix/templates/aspro_max/js/main.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 2634var basketTimeoutSlide; 2635var resizeEventTimer; 2636 2637var clicked_tab = 0; 2638 2639if (typeof arAsproOptions === "undefined") { 2640 var arAsproOptions = { 2641 SITE_DIR: "/", 2642 }; 2643 if ($("body").data("site") !== undefined) arAsproOptions["SITE_DIR"] = $("body").data("site"); 2644} 2645 2646function readyDOM(callback) { 2647 if (document.readyState !== "loading") callback(); 2648 else document.addEventListener("DOMContentLoaded", callback); 2649} 2650 2651var typeofExt = function (item) { 2652 const _toString = Object.prototype.toString; 2653 return _toString.call(item).slice(8, -1).toLowerCase(); 2654}; 2655 2656function loadScripts(scripts, cb) { 2657 function addVersionToScripts(scripts) { 2658 const version = "?v=" + arAsproOptions["MODULE_VERSION"]; 2659 if (Array.isArray(scripts)) { 2660 scripts.forEach(function (item, i, arr) { 2661 arr[i] += version; 2662 }); 2663 } else if (typeof scripts === "string") { 2664 scripts += version; 2665 } 2666 return scripts; 2667 } 2668 2669 scripts = addVersionToScripts(scripts); 2670 BX.loadScript(scripts, function () { 2671 if (typeof cb === "function") { 2672 cb(); 2673 } 2674 }); 2675} 2676 2677function loadJQM(cb) { 2678 if (typeof $.fn.jqm === "function") { 2679 cb(); 2680 } else { 2681 BX.loadScript(arAsproOptions["SITE_TEMPLATE_PATH"] + "/js/jqModal.js?v=2.2.5", () => cb()); 2682 } 2683} 2684 2685var InitLazyLoad = function () {}; 2686 2687$(document).on("change", ".uploader input[type=file]", function () { 2688 if (!$(this).next().length || !$(this).next().hasClass("resetfile")) { 2689 $( 2690 '<span class="resetfile"><svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewB
2690ox="0 0 11 11"><path d="M1345.19,376.484l4.66,4.659a0.492,0.492,0,0,1,0,.707,0.5,0.5,0,0,1-.71,0l-4.66-4.659-4.65,4.659a0.5,0.5,0,0,1-.71,0,0.492,0.492,0,0,1,0-.707l4.66-4.659-4.66-4.659a0.492,0.492,0,0,1,0-.707,0.5,0.5,0,0,1,.71,0l4.65,4.659,4.66-4.659a0.5,0.5,0,0,1,.71,0,0.492,0.492,0,0,1,0,.707Z" transform="translate(-1339 -371)"/></svg></span>' 2691 ).insertAfter($(this)); 2692 } 2693}); 2694 2695$(document).on("click", ".uploader.files_add input[type=file] + .resetfile", function () { 2696 var $input = $(this).prev(); 2697 $input.val(""); 2698 $.uniform.update($input); 2699 $(this).remove(); 2700}); 2701 2702$(document).on("click", ".top_block h3", function () { 2703 if (window.matchMedia("(max-width: 550px)").matches) { 2704 var $this = $(this); 2705 var a = $this.siblings("a"); 2706 if (a.length) { 2707 a[0].click(); 2708 } 2709 } 2710}); 2711 2712$(document).on("click", ".bx-yandex-view-layout .yandex-map__mobile-opener", function () { 2713 if ($(this).hasClass("closer")) { 2714 closeYandexMap(); 2715 } else { 2716 openYandexMap(this); 2717 } 2718}); 2719 2720function openYandexMap(element) { 2721 var $this = $(element); 2722 if ($this.hasClass("closer")) return; 2723 var currentMap = $this.parents(".bx-yandex-view-layout"); 2724 var mapId = currentMap.find(".bx-yandex-map").attr("id"); 2725 window.openedYandexMapFrame = mapId;
2726 var mapContainer = $('<div data-mapId="' + mapId + '"></div>'); 2727 if (!$("div[data-mapId=" + mapId + "]").length) { 2728 currentMap.after(mapContainer); 2729 } 2730 var yandexMapFrame = $('<div class="yandex-map__frame"></div>'); 2731 $("body .wrapper1").append(yandexMapFrame); 2732 currentMap.appendTo(yandexMapFrame); 2733 currentMap.find(".yandex-map__mobile-opener").addClass("closer"); 2734 window.map.container.fitToViewport(); 2735} 2736 2737function closeYandexMap() { 2738 var yandexMapFrame = $(".yandex-map__frame"); 2739 if (yandexMapFrame.length) { 2740 var currentMap = yandexMapFrame.find(".bx-yandex-view-layout"); 2741 var yandexMapContainer = $("div[data-mapId=" + window.openedYandexMapFrame + "]"); 2742 2743 currentMap.appendTo(yandexMapContainer); 2744 yandexMapFrame.remove(); 2745 currentMap.find(".yandex-map__mobile-opener").removeClass("closer"); 2746 if (window.map) { 2747 window.map.container.fitToViewport(); 2748 } 2749 } 2750} 2751 2752function throttle(f, t) { 2753 let throttled, saveThis, saveArgs; 2754 const wrapper = function () { 2755 if (throttled) { 2756 saveThis = this; 2757 saveArgs = arguments; 2758 return; 2759 } 2760 throttled = true; 2761 f.apply(this, arguments); 2762 setTimeout(function () { 2763 throttled = false; 2764 if (saveArgs) { 2765 wrapper.apply(saveThis, saveArgs); 2766 saveThis = saveArgs = null; 2767 } 2768 }, t); 2769 }; 2770 return wrapper; 2771} 2772 2773function debounce(f, t) { 2774 return function (args) { 2775 var previousCall = this.lastCall; 2776 this.lastCall = Date.now(); 2777 if (previousCall && this.lastCall - previousCall <= t) { 2778 clearTimeout(this.lastCallTimer); 2779 } 2780 this.lastCallTimer = setTimeout(function () { 2781 f(args); 2782 }, t); 2783 }; 2784} 2785 2786$.fn.iAppear = function (callback, options) { 2787 if (typeof $.fn.iAppear.useObserver === "undefined") { 2788 $.fn.iAppear.useObserver = typeof window["IntersectionObserver"] === "function"; 2789 2790 if (!$.fn.iAppear.useObserver && typeof $.fn.appear !== "function") { 2791 $.fn.iAppear.queue = []; 2792 BX.loadScript(arAsproOptions.SITE_TEMPLATE_PATH + "/vendor/js/jquery.appear.js", function () { 2793 if (typeof $.fn.iAppear.queue === "object") { 2794 $.fn.iAppear.queue.forEach(function (queueItem) { 2795 $(queueItem.items).iAppear(queueItem.callback, queueItem.options); 2796 }); 2797 } 2798 }); 2799 2800 return; 2801 } 2802 } 2803 2804 if ($.fn.iAppear.useObserver) { 2805 var options = $.extend( 2806 { 2807 root: null, 2808 rootMargin: "150px 0px 150px 0px", 2809 threshold: 0.0, 2810 }, 2811 options 2812 ); 2813 2814 $(this).each(function (i, appearBlock) { 2815 var observer = new IntersectionObserver(function (entries, observer) { 2816 entries.forEach(function (element) { 2817 if (element.intersectionRatio > 0 && !element.target.dataset.iAppeared) { 2818 element.target.dataset.iAppeared = true; 2819 2820 if (typeof callback === "function") { 2821 callback.call(element.target); 2822 } 2823 } 2824 }); 2825 }, options); 2826 2827 observer.observe(appearBlock); 2828 }); 2829 } else { 2830 if (typeof $.fn.appear !== "function") { 2831 if ($(this).length) { 2832 $.fn.iAppear.queue.push({ 2833 items: this, 2834 callback: callback, 2835 options: options, 2836 }); 2837 } 2838 2839 return; 2840 } else { 2841 if ($(this).length) { 2842 $(this).each(function (i, appearBlock) { 2843 $(appearBlock).appear(function () { 2844 if (typeof callback === "function") { 2845 callback.call(appearBlock); 2846 } 2847 }, options); 2848 }); 2849 } 2850 } 2851 } 2852}; 2853 2854$(document).on("click", ".flex-control-nav.flex-control-js-click li a:not(.flex-active)", function (e) { 2855 var _this = $(this); 2856 var itemIndex = _this.data("index") ? _this.data("index") : _this.closest("li").index(); 2857 2858 var block = ""; 2859 var blocks = _this.closest(".items").find("> .item"); 2860 var activeBlock = _this.closest(".items").find(".item.active"); 2861 2862 var activeLi = _this.closest(".flex-control-nav").find(".flex-active"); 2863 2864 activeBlock.fadeOut(function () { 2865 activeBlock.removeClass("active"); 2866 2867 block = blocks.eq(itemIndex); 2868 if (block.length) { 2869 block.fadeIn(function () { 2870 block.addClass("active"); 2871 }); 2872 } 2873 2874 _this.addClass("flex-active"); 2875 activeLi.removeClass("flex-active"); 2876 }); 2877 2878 e.preventDefault(); 2879}); 2880 2881$(document).on("mouseenter", "#headerfixed .menu-item.wide_menu", function () { 2882 var _this = $(this); 2883 setTimeout(function () { 2884 var dropdownMenu = _this.find(".wrap > .dropdown-menu"); 2885 var menuOffset = dropdownMenu[0].getBoundingClientRect(); 2886 var headerOffset = document.getElementById("headerfixed").getBoundingClientRect(); 2887 var windowHeight = document.documentElement.clientHeight; 2888 2889 if (menuOffset.height + headerOffset.height > windowHeight) { 2890 var maxHeight = windowHeight - headerOffset.height; 2891 dropdownMenu.css({ 2892 "max-height": maxHeight, 2893 }); 2894 dropdownMenu.find(".menu-navigation").css({ "max-height": maxHeight }); 2895 dropdownMenu.find(".customScrollbar").css({ "max-height": maxHeight }); 2896 dropdownMenu.find(".menu-wrapper.menu-type-4 > li").css({ "min-height": "auto" }); 2897 } else { 2898 dropdownMenu.css({ 2899 "max-height": "", 2900 }); 2901 dropdownMenu.find(".menu-navigation").css({ "max-height": "" }); 2902 dropdownMenu.find(".customScrollbar").css({ "max-height": "" }); 2903 dropdownMenu.find(".menu-wrapper.menu-type-4 > li").css({ "min-height": "" }); 2904 } 2905 }, 300); 2906}); 2907 2908BX.addCustomEvent("onAjaxSuccess", function (data) { 2909 if (typeof data === "object" && data !== null) { 2910 if ( 2911 typeof data.BASKET_REFRESHED !== undefined && 2912 data.BASKET_REFRESHED === true && 2913 typeof data.BASKET_DATA === "object" && 2914 data.BASKET_DATA 2915 ) { 2916 var basketCounts = data.BASKET_DATA.BASKET_ITEMS_COUNT; 2917 reloadBasketCounters(basketCounts); 2918 } 2919 } 2920}); 2921 2922BX.addCustomEvent("onHeaderProgressBarChange", function (data) { 2923 if (typeof updateProgressBar === "function") { 2924 updateProgressBar(); 2925 } 2926}); 2927 2928if (!funcDefined("parseUrlQuery")) { 2929 parseUrlQuery = function () { 2930 var data = {}; 2931 if (location.search) { 2932 var pair = location.search.substr(1).split("&"); 2933 for (var i = 0; i < pair.length; i++) { 2934 var param = pair[i].split("="); 2935 data[param[0]] = param[1]; 2936 } 2937 } 2938 return data; 2939 }; 2940} 2941 2942if (!funcDefined("setLocationSKU")) { 2943 function setLocationSKU(ID, urlParam) { 2944 if (urlParam === undefined) urlParam = "oid"; 2945 2946 var objUrl = parseUrlQuery(), 2947 j = 0, 2948 prefix = "", 2949 query_string = "", 2950 url = ""; 2951 2952 objUrl[urlParam] = ID; 2953 2954 for (var i in objUrl) { 2955 if (parseInt(j) > 0) prefix = "&"; 2956 query_string = query_string + prefix + i + "=" + objUrl[i]; 2957 j++; 2958 } 2959 if (query_string) { 2960 url = location.pathname + "?" + query_string + location.hash; 2961 } 2962 try { 2963 //history.pushState(null, null, url); 2964 history.replaceState(null, null, url); 2965 return; 2966 } catch (e) {} 2967 location.hash = "#" + url.substr(1); 2968 } 2969} 2970 2971if (!funcDefined("ShowOverlay")) { 2972 ShowOverlay = function () { 2973 $('<div class="jqmOverlay waiting"></div>').appendTo("body"); 2974 }; 2975} 2976 2977if (!funcDefined("HideOverlay")) { 2978 HideOverlay = function () { 2979 $(".jqmOverlay").detach(); 2980 }; 2981} 2982 2983if (!funcDefined("trimPrice")) { 2984 var trimPrice = function trimPrice(s) { 2985 s = s.split(" ").join(""); 2986 s = s.split(" ").join(""); 2987 return s; 2988 }; 2989} 2990 2991if (!funcDefined("pauseYmObserver")) { 2992 // pause ya metrika webvisor MutationObserver callback (DOM indexer) 2993 // use before insert html with some animation 2994 pauseYmObserver = function () { 2995 if ( 2996 typeof MutationObserver === "function" && 2997 typeof MutationObserver.observers === "object" && 2998 typeof MutationObserver.observers.ym === "object" 2999 ) { 3000 if (typeof pauseYmObserver.cnt === "undefined") { 3001 pauseYmObserver.cnt = 0; 3002 } 3003 3004 ++pauseYmObserver.cnt; 3005 3006 if (!MutationObserver.observers.ym.paused) { 3007 MutationObserver.observers.ym.pause(); 3008 } 3009 } 3010 }; 3011} 3012 3013if (!funcDefined("resumeYmObserver")) { 3014 // resume ya metrika webvisor MutationObserver callback 3015 // use when animation finished 3016 resumeYmObserver = function () { 3017 if ( 3018 typeof MutationObserver === "function" && 3019 typeof MutationObserver.observers === "object" && 3020 typeof MutationObserver.observers.ym === "object" 3021 ) { 3022 if (typeof pauseYmObserver.cnt === "undefined") { 3023 pauseYmObserver.cnt = 1; 3024 } 3025 3026 pauseYmObserver.cnt -= pauseYmObserver.cnt > 0 ? 1 : 0; 3027 3028 if (!pauseYmObserver.cnt && MutationObserver.observers.ym.paused) { 3029 MutationObserver.observers.ym.resume(); 3030 } 3031 } 3032 }; 3033} 3034 3035if (!funcDefined("markProductRemoveBasket")) { 3036 var markProductRemoveBasket = function markProductRemoveBasket(id) { 3037 $(".in-cart[data-item=" + id + "]").hide(); 3038 $(".to-cart[data-item=" + id + "]").show(); 3039 if ( 3040 $(".to-cart[data-item=" + id + "]") 3041 .closest(".counter_wrapp") 3042 .find(".counter_block").length 3043 ) { 3044 $(".to-cart[data-item=" + id + "]") 3045 .closest(".button_block") 3046 .removeClass("wide"); 3047 } 3048 $(".to-cart[data-item=" + id + "]") 3049 .closest(".counter_wrapp") 3050 .find(".counter_block") 3051 .show(); 3052 $(".counter_block[data-item=" + id + "]") 3053 .closest(".counter_block_inner") 3054 .show(); 3055 $(".counter_block[data-item=" + id + "]").show(); 3056 $(".in-subscribe[data-item=" + id + "]").hide(); 3057 $(".to-subscribe[data-item=" + id + "]").show(); 3058 3059 $(".banner_buttons.with_actions .wraps_buttons[data-id=" + id + "] .basket_item_add").removeClass("added"); 3060 3061 if ($("#headerfixed .but-cell .type_block").length) { 3062 $("#headerfixed .but-cell .type_block span").text(BX.message("MORE_INFO_SKU")); 3063 $("#headerfixed .but-cell .type_block .svg-inline-fw").remove(); 3064 } 3065 }; 3066} 3067 3068if (!funcDefined("markProductAddBasket")) { 3069 var markProductAddBasket = function markProductAddBasket(id) { 3070 $(".to-cart[data-item=" + id + "]").hide(); 3071 $(".to-cart[data-item=" + id + "]") 3072 .closest(".counter_wrapp") 3073 .find(".counter_block_inner") 3074 .hide(); 3075 $(".to-cart[data-item=" + id + "]") 3076 .closest(".counter_wrapp") 3077 .find(".counter_block") 3078 .hide(); 3079 $(".to-cart[data-item=" + id + "]") 3080 .closest(".button_block") 3081 .addClass("wide"); 3082 $(".in-cart[data-item=" + id + "]").show(); 3083 3084 $(".banner_buttons.with_actions .wraps_buttons[data-id=" + id + "] .basket_item_add").addClass("added"); 3085 3086 if ($("#headerfixed .but-cell .type_block").length) { 3087 $("#headerfixed .but-cell .type_block").html($(".in-cart[data-item=" + id + "]").html()); 3088 } 3089 }; 3090} 3091 3092if (!funcDefined("markProductDelay")) {
3093 var markProductDelay = function markProductDelay(id) { 3094 $(".in-cart[data-item=" + id + "]").hide(); 3095 $(".to-cart[data-item=" + id + "]").show(); 3096 $(".to-cart[data-item=" + id + "]") 3097 .closest(".counter_wrapp") 3098 .find(".counter_block_inner") 3099 .show(); 3100 $(".to-cart[data-item=" + id + "]") 3101 .closest(".counter_wrapp") 3102 .find(".counter_block") 3103 .show(); 3104 if ( 3105 $(".to-cart[data-item=" + id + "]") 3106 .closest(".counter_wrapp") 3107 .find(".counter_block").length 3108 ) { 3109 $(".to-cart[data-item=" + id + "]") 3110 .closest(".button_block") 3111 .removeClass("wide"); 3112 } 3113 3114 if ($("#headerfixed .but-cell .type_block").length) { 3115 $("#headerfixed .but-cell .type_block span").text(BX.message("MORE_INFO_SKU")); 3116 $("#headerfixed .but-cell .type_block .svg-inline-fw").remove(); 3117 } 3118 }; 3119} 3120 3121if (!funcDefined("markProductSubscribe")) { 3122 var markProductSubscribe = function markProductSubscribe(id) { 3123 $(".to-subscribe[data-item=" + id + "]").hide(); 3124 $(".in-subscribe[data-item=" + id + "]").css("display", "block"); 3125 }; 3126} 3127 3128if (!funcDefined("updateBottomIconsPanel")) { 3129 var updateBottomIconsPanel = function updateBottomIconsPanel(options) { 3130 if (options && $(".bottom-icons-panel").length) { 3131 var bBasketUpdate = "READY" in options || "BASKET_COUNT" in options; 3132 var basketCount = "READY" in options ? options.READY.COUNT : "BASKET_COUNT" in options ? options.BASKET_COUNT : 0; 3133 var basketTitle = 3134 "READY" in options ? options.READY.TITLE : "BASKET_SUMM_TITLE" in options ? options.BASKET_SUMM_TITLE : ""; 3135 3136 //basket 3137 if (bBasketUpdate) { 3138 if (+basketCount > 0) { 3139 $(".bottom-icons-panel .basket.counter-state").removeClass("counter-state--empty"); 3140 } else { 3141 $(".bottom-icons-panel .basket.counter-state").addClass("counter-state--empty"); 3142 } 3143 $(".bottom-icons-panel .basket .counter-state__content-item-value").text(basketCount); 3144 $(".bottom-icons-panel .basket") 3145 .closest(".bottom-icons-panel__content-link") 3146 .attr("title", $("<div/>").html(basketTitle).text()); 3147 } 3148 // 3149 } 3150 }; 3151} 3152if (!funcDefined("basketFly")) { 3153 var basketFly = function basketFly(action, opener) { 3154 if (typeof obMaxPredictions === "object") { 3155 obMaxPredictions.updateAll(); 3156 } 3157 3158 $.post( 3159 arAsproOptions["SITE_DIR"] + "ajax/basket_fly.php", 3160 "PARAMS=" + $("#basket_form").find("input#fly_basket_params").val(), 3161 $.proxy(function (data) { 3162 var small = $(".opener .basket_count").hasClass("small"), 3163 basket_count = $(data).find(".basket_count").find(".items div").text(); 3164 $("#basket_line .basket_fly").addClass("loaded").html(data); 3165 3166 if (action == "refresh") $("li[data-type=AnDelCanBuy]").trigger("click"); 3167 3168 if (typeof opener == "undefined" || $("#basket_line .basket_fly").hasClass("loading")) { 3169 if (window.matchMedia("(min-width: 769px)").matches) { 3170 if (action == "open") { 3171 if (small) { 3172 if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") { 3173 $(".opener .basket_count").click(); 3174 } 3175 } else { 3176 $(".opener .basket_count").removeClass("small"); 3177 $('.tabs_content.basket li[item-section="AnDelCanBuy"]').addClass("cur"); 3178 $('#basket_line ul.tabs li[item-section="AnDelCanBuy"]').addClass("cur"); 3179 3180 $("#basket_line .basket_fly .opener > div:eq(0)").addClass("cur"); 3181 } 3182 } else { 3183 if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") { 3184 $(".opener .basket_count").click(); 3185 } 3186 } 3187 } 3188 } else if (opener === "SHOW") { 3189 if (window.matchMedia("(min-width: 769px)").matches) { 3190 $(".opener .basket_count").removeClass("small"); 3191 $('.tabs_content.basket li[item-section="AnDelCanBuy"]').addClass("cur"); 3192 $('#basket_line ul.tabs li[item-section="AnDelCanBuy"]').addClass("cur"); 3193 $("#basket_line .basket_fly .opener > div:eq(0)").addClass("cur"); 3194 } 3195 } 3196 }) 3197 ); 3198 }; 3199} 3200 3201if (!funcDefined("basketTop")) { 3202 var basketTop = function basketTop(action, hoverBlock) { 3203 if (action == "reload") { 3204 if ($(".basket_hover_block:hover").length) { 3205 hoverBlock = $(".basket_hover_block:hover"); 3206 } 3207 } 3208 3209 if (action == "open") { 3210 if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") { 3211 if ($("#headerfixed").hasClass("fixed")) { 3212 hoverBlock = $("#headerfixed .basket_hover_block"); 3213 } else { 3214 hoverBlock = $(".top_basket .basket_hover_block"); 3215 } 3216 } 3217 } 3218 3219 if (hoverBlock === undefined) { 3220 console.log("Undefined hoverBlock"); 3221 console.trace(); 3222 return false;
3223 } 3224 3225 if (action == "close") { 3226 if (hoverBlock.length) { 3227 hoverBlock.css({ 3228 opacity: "", 3229 visibility: "", 3230 }); 3231 return true; 3232 } 3233 } 3234 3235 hoverBlock.removeClass("loaded"); 3236 var firstTime = hoverBlock.find("div").length ? "false" : "true"; 3237 var params = $("#basket_form").find("input#fly_basket_params").val(); 3238 var postData = { 3239 firstTime: firstTime, 3240 }; 3241 if (params !== undefined) { 3242 postData.PARAMS = params; 3243 } 3244 3245 $.post( 3246 arAsproOptions["SITE_DIR"] + "ajax/showBasketHover.php", 3247 postData, 3248 $.proxy(function (data) { 3249 var ob = BX.processHTML(data); 3250 // inject 3251 $("#headerfixed .basket .basket_hover_block, .top_basket .basket_hover_block").html(ob.HTML); 3252 BX.ajax.processScripts(ob.SCRIPT); 3253 if (window.matchMedia("(min-width: 992px)").matches) { 3254 hoverBlock.addClass("loaded"); 3255 3256 if (action == "open") { 3257 if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") { 3258 if ($("#headerfixed").hasClass("fixed")) { 3259 hoverBlock = $("#headerfixed .basket + .basket_hover_block"); 3260 } else { 3261 hoverBlock = $(".top_basket .basket_hover_block"); 3262 } 3263 3264 hoverBlock.css({ 3265 opacity: "1", 3266 visibility: "visible", 3267 }); 3268 3269 setTimeout(function () { 3270 hoverBlock.css({ 3271 opacity: "", 3272 visibility: "", 3273 }); 3274 }, 2000); 3275 } 3276 } 3277 } 3278 }) 3279 ); 3280 }; 3281} 3282 3283$(document).on("click", "#basket_toolbar_button", function () { 3284 if (lastHash) location.hash = "cart"; 3285}); 3286$(document).on("click", "#basket_toolbar_button_delayed", function () { 3287 if (lastHash) location.hash = "delayed"; 3288}); 3289if (location.hash) { 3290 var hash = location.hash; 3291} 3292//work with hash end 3293 3294$(document).on("click", "#basket_line .basket_fly .opener > div.clicked", function () { 3295 if (arAsproOptions["PAGES"]["BASKET_PAGE"]) return; 3296 function onOpenFlyBasket(_this) { 3297 $("#basket_line .basket_fly .tabs li").removeClass("cur"); 3298 $("#basket_line .basket_fly .tabs_content li").removeClass("cur"); 3299 // $("#basket_line .basket_fly .remove_all_basket").removeClass("cur"); 3300 if (!$(_this).is(".wish_count.empty")) { 3301 $("#basket_line .basket_fly .tabs_content li[item-section=" + $(_this).data("type") + "]").addClass("cur"); 3302 $("#basket_line .basket_fly .tabs li:eq(" + $(_this).index() + ")").addClass("cur"); 3303 // $("#basket_line .basket_fly .remove_all_basket."+$(_this).data("type")).addClass("cur"); 3304 } else { 3305 $("#basket_line .basket_fly .tabs li").first().addClass("cur").siblings().removeClass("cur"); 3306 $("#basket_line .basket_fly .tabs_content li").first().addClass("cur").siblings().removeClass("cur"); 3307 // $("#basket_line .basket_fly .remove_all_basket").first().addClass("cur"); 3308 } 3309 $("#basket_line .basket_fly .opener > div.clicked").removeClass("small"); 3310 3311 $("#basket_line .basket_fly .opener > div").siblings().removeClass("cur"); 3312 $("#basket_line .basket_fly .opener > div:eq(" + $(_this).index() + ")").addClass("cur"); 3313 } 3314 3315 if (window.matchMedia("(min-width: 769px)").matches) { 3316 var _this = this; 3317 3318 $(_this).siblings().removeClass("cur"); 3319 $(_this).addClass("cur"); 3320 3321 if (parseInt($("#basket_line .basket_fly").css("right")) < 0) { 3322 $("#basket_line .basket_fly") 3323 .stop() 3324 .addClass("loading") 3325 .animate({ right: "0" }, 333, function () { 3326 if ($(_this).closest(".basket_fly.loaded").length) { 3327 onOpenFlyBasket(_this); 3328 } else { 3329 $.ajax({ 3330 url: arAsproOptions["SITE_DIR"] + "ajax/basket_fly.php", 3331 type: "post", 3332 success: function (html) { 3333 $("#basket_line .basket_fly").removeClass("loading").addClass("loaded").html(html); 3334 onOpenFlyBasket(_this); 3335 }, 3336 }); 3337 } 3338 }); 3339 $("#basket_line .basket_fly").addClass("swiped"); 3340 } else if ( 3341 $(this).is(".wish_count:not(.empty)") && 3342 !$("#basket_line .basket_fly .basket_sort ul.tabs li.cur").is("[item-section=DelDelCanBuy]") 3343 ) { 3344 $("#basket_line .basket_fly .tabs li").removeClass("cur"); 3345 $("#basket_line .basket_fly .tabs_content li").removeClass("cur"); 3346 // $("#basket_line .basket_fly .remove_all_basket").removeClass("cur"); 3347 $("#basket_line .basket_fly .tabs_content li[item-section=" + $(this).data("type") + "]").addClass("cur"); 3348 $("#basket_line .basket_fly .tabs li:eq(" + $(this).index() + ")") 3349 .first() 3350 .addClass("cur"); 3351 // $("#basket_line .basket_fly .remove_all_basket."+$(this).data("type")).first().addClass("cur"); 3352 } else if ( 3353 $(this).is(".basket_count") && 3354 $("#basket_line .basket_fly .basket_sort ul.tabs li.cur").length && 3355 !$("#basket_line .basket_fly .basket_sort ul.tabs li.cur").is("[item-section=AnDelCanBuy]") 3356 ) { 3357 $("#basket_line .basket_fly .tabs li").removeClass("cur"); 3358 $("#basket_line .basket_fly .tabs_content li").removeClass("cur"); 3359 // $("#basket_line .basket_fly .remove_all_basket").removeClass("cur"); 3360 $("#basket_line .basket_fly .tabs_content li:eq(" + $(this).index() + ")").addClass("cur"); 3361 $("#basket_line .basket_fly .tabs li:eq(" + $(this).index() + ")") 3362 .first() 3363 .addClass("cur"); 3364 // $("#basket_line .basket_fly .remove_all_basket."+$(this).data("type")).first().addClass("cur"); 3365 } else { 3366 $("#basket_line .basket_fly") 3367 .stop() 3368 .animate({ right: -$("#basket_line .basket_fly").outerWidth() }, 150); 3369 $("#basket_line .basket_fly .opener > div.clicked").addClass("small"); 3370 $("#basket_line .basket_fly").removeClass("swiped"); 3371 $("#basket_line .basket_fly .opener > div").removeClass("cur"); 3372 } 3373 } 3374}); 3375 3376if (!funcDefined("clearViewedProduct")) { 3377 function clearViewedProduct() { 3378 try { 3379 var siteID = arAsproOptions.SITE_ID; 3380 var localKey = "MAX_VIEWED_ITEMS_" + siteID; 3381 var cookieParams = { path: "/", expires: 30 }; 3382 if (typeof BX.localStorage !== "undefined") { 3383 // remove local storage 3384 BX.localStorage.set(localKey, {}, 0); 3385 } 3386 // remove cookie 3387 $.removeCookie(localKey, cookieParams); 3388 } catch (e) { 3389 console.error(e); 3390 } 3391 } 3392} 3393
3394if (!funcDefined("setViewedProduct")) { 3395 function setViewedProduct(id, arData) { 3396 try { 3397 // save $.cookie option 3398 var bCookieJson = $.cookie.json; 3399 $.cookie.json = true; 3400 3401 var siteID = arAsproOptions.SITE_ID; 3402 var localKey = "MAX_VIEWED_ITEMS_" + siteID; 3403 var cookieParams = { path: "/", expires: 30 }; 3404 3405 if (typeof BX.localStorage !== "undefined" && typeof id !== "undefined" && typeof arData !== "undefined") { 3406 var PRODUCT_ID = typeof arData.PRODUCT_ID !== "undefined" ? arData.PRODUCT_ID : id; 3407 var arViewedLocal = BX.localStorage.get(localKey) ? BX.localStorage.get(localKey) : {}; 3408 var arViewedCookie = $.cookie(localKey) ? $.cookie(localKey) : {}; 3409 var count = 0; 3410 3411 // delete some items (sync cookie & local storage) 3412 for (var _id in arViewedLocal) { 3413 arViewedLocal[_id].IS_LAST = false; 3414 if (typeof arViewedCookie[_id] === "undefined") { 3415 delete arViewedLocal[_id]; 3416 } 3417 } 3418 for (var _id in arViewedCookie) { 3419 if (typeof arViewedLocal[_id] === "undefined") { 3420 delete arViewedCookie[_id]; 3421 } 3422 } 3423 3424 for (var _id in arViewedCookie) { 3425 count++; 3426 } 3427 3428 // delete item if other item (offer) of that PRODUCT_ID is exists 3429 if (typeof arViewedLocal[PRODUCT_ID] !== "undefined") { 3430 if (arViewedLocal[PRODUCT_ID].ID != id) { 3431 delete arViewedLocal[PRODUCT_ID]; 3432 delete arViewedCookie[PRODUCT_ID]; 3433 } 3434 } 3435 3436 var time = new Date().getTime(); 3437 arData.ID = id; 3438 arData.ACTIVE_FROM = time; 3439 arData.IS_LAST = true; 3440 arViewedLocal[PRODUCT_ID] = arData; 3441 arViewedCookie[PRODUCT_ID] = [time.toString(), arData.PICTURE_ID]; 3442 3443 $.cookie(localKey, arViewedCookie, cookieParams); 3444 BX.localStorage.set(localKey, arViewedLocal, 2592000); // 30 days 3445 } 3446 } catch (e) { 3447 console.error(e); 3448 } finally { 3449 // restore $.cookie option 3450 $.cookie.json = bCookieJson; 3451 } 3452 } 3453} 3454 3455if (!funcDefined("initSelects")) { 3456 function initSelects(target) { 3457 if (!$.fn.ikSelect) return; 3458 var iOS = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false; 3459 if (iOS && !$(".wrapper1.iks-on-ios").length) return; 3460 if ($("#bx-soa-order").length || $("#bx-soa-order-main").length) return; 3461 3462 if (!$(".wrapper1.iks-ignore").length) { 3463 const $target = $(target).find( 3464 ".wrapper1 select:visible:not(.iks-ignore), .jqmWindow select:visible:not(.iks-ignore)" 3465 ); 3466 3467 if ($target.length) { 3468 // SELECT STYLING 3469 $target.ikSelect({ 3470 syntax: 3471 '<div class="ik_select_link"> \ 3472 <span class="ik_select_link_text"></span> \ 3473 <div class="trigger"></div> \ 3474 </div> \ 3475 <div class="ik_select_dropdown"> \ 3476 <div class="ik_select_list"> \ 3477 </div> \ 3478 </div>', 3479 dynamicWidth: true, 3480 ddMaxHeight: 112, 3481 customClass: "common_select", 3482 //equalWidths: true, 3483 onShow: function (inst) { 3484 inst.$dropdown.css("top", parseFloat(inst.$dropdown.css("top")) - 5 + "px"); 3485 if (inst.$dropdown.outerWidth() < inst.$link.outerWidth()) { 3486 inst.$dropdown.css("width", inst.$link.outerWidth()); 3487 } 3488 if (inst.$dropdown.outerWidth() > inst.$link.outerWidth()) { 3489 inst.$dropdown.css("width", inst.$link.outerWidth()); 3490 } 3491 var count = 0, 3492 client_height = 0; 3493 inst.$dropdown.css("left", inst.$link.offset().left); 3494 $(inst.$listInnerUl) 3495 .find("li") 3496 .each(function () { 3497 if (!$(this).hasClass("ik_select_option_disabled")) { 3498 ++count; 3499 client_height += $(this).outerHeight(); 3500 } 3501 }); 3502 if (client_height < 112) { 3503 inst.$listInner.css("height", "auto"); 3504 } else { 3505 inst.$listInner.css("height", "112px"); 3506 } 3507 inst.$link.addClass("opened"); 3508 inst.$listInner.addClass("scroller scrollblock"); 3509 if ($(".confirm_region").length) $(".confirm_region").remove(); 3510 }, 3511 onHide: function (inst) { 3512 inst.$link.removeClass("opened"); 3513 }, 3514 }); 3515 // END OF SELECT STYLING 3516 3517 var timeout; 3518 $(window).on("resize", function () { 3519 ignoreResize.push(true); 3520 clearTimeout(timeout); 3521 timeout = setTimeout(function () { 3522 //$('select:visible').ikSelect('redraw'); 3523 var inst = ""; 3524 if ((inst = $(".common_select-link.opened + select").ikSelect().data("plugin_ikSelect"))) { 3525 inst.$dropdown.css("left", inst.$link.offset().left + "px"); 3526 } 3527 }, 20); 3528 ignoreResize.pop(); 3529 }); 3530 } 3531 } 3532 } 3533} 3534 3535if (!funcDefined("CheckTopMenuFullCatalogSubmenu")) { 3536 CheckTopMenuFullCatalogSubmenu = function () { 3537 if (window.matchMedia("(max-width: 991px)").matches) return; 3538 3539 if (arAsproOptions["THEME"] && arAsproOptions["THEME"]["MENU_TYPE_VIEW"] != "HOVER") return; 3540 3541 var $menu = $(".left_block .menu_top_block"); 3542 if ($menu.length) { 3543 var $wrapmenu = $menu.parents(".wrap_menu"); 3544 3545 var wrapMenuWidth = $menu.closest(".wrapper_inner").actual("width"); 3546 if (!wrapMenuWidth) wrapMenuWidth = $menu.closest(".wraps").actual("width"); 3547 3548 var bCatalogFirst = $menu.hasClass("catalogfirst"); 3549 var findMenuLi = $(".left_block .menu_top_block:visible li.full"); 3550 var parentSubmenuWidth = $menu.actual("outerWidth"); 3551 var wrapMenuLeft = 0; 3552 var wrapMenuRight = 0; 3553 3554 if ($wrapmenu.length) { 3555 wrapMenuWidth = $wrapmenu.actual("outerWidth"); 3556 wrapMenuLeft = $wrapmenu.offset().left; 3557 wrapMenuRight = wrapMenuLeft + wrapMenuWidth; 3558 } 3559 3560 if ($(".left_block .catalog_block.menu_top_block").length) { 3561 if ($(".left_block .catalog_block.menu_top_block").is(":visible")) 3562 findMenuLi = $(".left_block .menu_top_block.catalog_block li.full"); 3563 } 3564 findMenuLi.each(function () { 3565 var $this = $(this); 3566 var $submenu = $this.find(">.dropdown"); 3567 3568 if ($submenu.length) { 3569 // $submenu.css({left: parentSubmenuWidth + 'px', width: (wrapMenuWidth - parentSubmenuWidth) + 'px', 'padding-left': '0px', 'padding-right': '0px', 'opacity': 1}); 3570 //$submenu.css({ width: wrapMenuWidth - parentSubmenuWidth + "px" }); 3571 3572 if (!isOnceInited && arAsproOptions["THEME"]["MENU_POSITION"] == "TOP") { 3573 $this.on("mouseenter", function () { 3574 $submenu.css("min-height", $this.closest(".dropdown").actual("outerHeight") + "px"); 3575 }); 3576 } 3577 } 3578 }); 3579 } 3580 }; 3581} 3582 3583$.fn.getMaxHeights = function (outer, classNull, minHeight) { 3584 var maxHeight = this.map(function (i, e) { 3585 var calc_height = 0; 3586 $(e).css("height", ""); 3587 3588 if (outer == true) calc_height = $(e).actual("outerHeight"); 3589 else calc_height = $(e).actual("height"); 3590 3591 return calc_height; 3592 }).get(); 3593 for (var i = 0, c = maxHeight.length; i < c; ++i) { 3594 if (maxHeight[i] % 2) --maxHeight[i]; 3595 } 3596 return Math.max.apply(this, maxHeight); 3597}; 3598 3599$.fn.equalizeHeights = function (outer, classNull, options) { 3600 var maxHeight = []; 3601 var items = []; 3602 3603 for (var i = 0, itemKey = 0; i < this.length; itemKey++) { 3604 var item = this[itemKey], 3605 _item = $(item), 3606 minus_height = 0, 3607 calc_height = 0; 3608 3609 i++; 3610 3611 if (options.blockNull !== undefined) { 3612 if (options.blockNull.class !== undefined) { 3613 if (_item.hasClass(options.blockNull.class) || _item.closest("." + options.blockNull.class).length) { 3614 continue; 3615 } 3616 } 3617 } 3618 3619 items.push(this[itemKey]); 3620 3621 if (classNull !== false) { 3622 if (!isMobile) { 3623 var nulled = _item.find(classNull); 3624 if (nulled.length) { 3625 minus_height = parseInt(nulled[0].offsetHeight); 3626 //minus_height=parseInt(_item.find(classNull).outerHeight(false)); 3627 //minus_height=parseInt(_item.find(classNull).actual('outerHeight')); 3628 } 3629 } 3630 } 3631 3632 if (minus_height) minus_height += 12; 3633 3634 _item.css("height", ""); 3635 3636 calc_height = item.offsetHeight - minus_height; 3637 3638 if (options.minHeight !== false) { 3639 if (calc_height < options.minHeight) calc_height += options.minHeight - calc_height; 3640 3641 if (window.matchMedia("(max-width: 520px)").matches) calc_height = 300; 3642 3643 if (window.matchMedia("(max-width: 400px)").matches) calc_height = 200; 3644 } 3645
3646 if (!calc_height) calc_height = 0; 3647 3648 maxHeight.push(calc_height); 3649 } 3650 3651 for (var i = 0, c = maxHeight.length; i < c; ++i) { 3652 if (maxHeight[i] % 2) { 3653 --maxHeight[i]; 3654 } 3655 } 3656 3657 var result = $(items).height(Math.max.apply(this, maxHeight)); 3658 3659 return result; 3660}; 3661 3662$.fn.getFloatWidth = function () { 3663 var width = 0; 3664 if ($(this).length) { 3665 var rect = $(this)[0].getBoundingClientRect(); 3666 if (!(width = rect.width)) width = rect.right - rect.left; 3667 } 3668 3669 $(this).data("floatWidth", width); 3670 3671 return width; 3672}; 3673 3674function extendDepthObject(target, FromObj) { 3675 var to = Object.assign({}, target); 3676 for (var key in FromObj) { 3677 if (typeof FromObj[key] == "object") { 3678 to[key] = extendDepthObject(to[key], FromObj[key]); 3679 } else { 3680 to[key] = FromObj[key]; 3681 } 3682 } 3683 3684 return to; 3685} 3686 3687$.fn.sliceHeight = function (options) { 3688 function _slice(el) { 3689 var arBreakpoints = Object.keys(options.breakpoint); 3690 var resizeOptionsTmp = {}; 3691 if (arBreakpoints.length) { 3692 for (var key in arBreakpoints) { 3693 if (window.matchMedia(arBreakpoints[key].toString()).matches) { 3694 resizeOptionsTmp = options.breakpoint[arBreakpoints[key]]; 3695 } 3696 } 3697 } 3698 3699 var resizeOptions = extendDepthObject(options, resizeOptionsTmp); 3700 3701 var blockNullClass = 3702 resizeOptions.blockNull !== undefined && resizeOptions.blockNull.class !== undefined 3703 ? resizeOptions.blockNull.class 3704 : false; 3705 var parent = 3706 typeof resizeOptions.row !== "undefined" && resizeOptions.row.length 3707 ? el.first().parents(resizeOptions.row) 3708 : el.first().parents(".items"); 3709 var item = ""; 3710 3711 if (typeof resizeOptions.item !== "undefined" && resizeOptions.item.length) { 3712 if (blockNullClass) { 3713 $(resizeOptions.item).each(function (i, element) { 3714 _element = $(element); 3715 if (!_element.hasClass(blockNullClass)) { 3716 item = _element; 3717 } 3718 }); 3719 if (!item) 3720 // if only ignored blocks 3721 return false; 3722 } else { 3723 item = $(resizeOptions.item).first(); 3724 } 3725 } else { 3726 if (el.first().hasClass("item")) { 3727 item = el.first(); 3728 } else { 3729 item = el.first().parents(".item"); 3730 } 3731 } 3732 3733 if (typeof resizeOptions.autoslicecount == "undefined" || resizeOptions.autoslicecount !== false) { 3734 var elsw = parent.getFloatWidth(), 3735 elw = item.getFloatWidth(); 3736 if (!elsw) { 3737 elsw = el.first().parents(".row").getFloatWidth(); 3738 } 3739 if (!elw) { 3740 if (typeof resizeOptions.item !== "undefined" && resizeOptions.item.length) 3741 elw = $(resizeOptions.item + ":eq(1)").getFloatWidth() 3742 ? $(resizeOptions.item + ":eq(1)").getFloatWidth() 3743 : $(resizeOptions.item + ":eq(2)").getFloatWidth(); 3744 else elw = $(el[1]).getFloatWidth() ? $(el[1]).getFloatWidth() : $(el[2]).getFloatWidth(); 3745 } 3746 if (elw && resizeOptions.fixWidth) elw -= resizeOptions.fixWidth; 3747 3748 elw = parseInt(elw * 100) / 100; 3749 3750 if (elsw && elw) { 3751 resizeOptions.slice = Math.floor(elsw / elw); 3752 } 3753 } 3754 3755 if (resizeOptions.customSlice) { 3756 //manual slice count 3757 var bSliceNext = false; 3758 if (resizeOptions.length) { 3759 elw = 3760 typeof resizeOptions.item !== "undefined" && resizeOptions.item.length 3761 ? $(resizeOptions.item).last().getFloatWidth() 3762 : el.last().hasClass("item") 3763 ? el.last().getFloatWidth() 3764 : el.last().parents(".item").getFloatWidth(); 3765 if (elw) resizeOptions.sliceNext = Math.floor(elsw / elw); 3766 3767 bSliceNext = true; 3768 } 3769 } 3770 3771 elements = []; 3772 if (resizeOptions.classes !== undefined && resizeOptions.classes.length) { 3773 for (var i = 0; i < resizeOptions.classes.length; i++) { 3774 var items = $(resizeOptions.item).find(resizeOptions.classes[i]); 3775 elements.push(items); 3776 } 3777 } 3778 var elIndex = elements.push(el) - 1; 3779 3780 if (resizeOptions.mobile == true) { 3781 if (window.matchMedia("(max-width: 500px)").matches) { 3782 for (var block = 0; block < elements.length; block++) { 3783 var items = $(elements[block]); 3784 items.css({ 3785 "line-height": "", 3786 height: "", 3787 }); 3788 } 3789 return; 3790 } 3791 } 3792 3793 if (typeof resizeOptions.typeResize == "undefined" || resizeOptions.typeResize == false) { 3794 if (resizeOptions.slice) { 3795 for (var block = 0; block < elements.length; block++) { 3796 if (resizeOptions.currentRow) { 3797 var itemNumber = el.index(resizeOptions.currentItem); 3798 var rowCount = resizeOptions.slice; 3799 var rowNumber = Math.floor(itemNumber / rowCount); 3800 3801 var items = $(elements[block].slice(rowNumber * rowCount, rowNumber * rowCount + rowCount)); 3802 var classNull = block == elIndex ? resizeOptions.classNull : false;
3803 items.css({ 3804 "line-height": "", 3805 height: "", 3806 }); 3807 items.equalizeHeights(resizeOptions.outer, classNull, resizeOptions); 3808 } else { 3809 for (var i = 0; i < elements[block].length; ) { 3810 if (resizeOptions.customSlice && resizeOptions.sliceNext && bSliceNext && i) 3811 //manual slice count 3812 resizeOptions.slice = resizeOptions.sliceNext; 3813 3814 var slice = resizeOptions.slice; 3815 var items = $(elements[block].slice(i, i + slice)); 3816 if (resizeOptions.blockNull !== undefined) { 3817 if (resizeOptions.blockNull.class !== undefined) { 3818 var counts = 0; 3819 items.each(function (i, item) { 3820 var _item = $(item); 3821 if ( 3822 _item.hasClass(resizeOptions.blockNull.class) || 3823 _item.closest("." + resizeOptions.blockNull.class).length 3824 ) { 3825 counts++; 3826 } 3827 }); 3828 } 3829 } 3830 if (counts) { 3831 slice -= (resizeOptions.blockNull.width - 1) * counts; 3832 } 3833 3834 items = $(elements[block].slice(i, i + slice)); 3835 if (items) { 3836 var classNull = block == elIndex ? resizeOptions.classNull : false; 3837 3838 items.css({ 3839 "line-height": "", 3840 height: "", 3841 }); 3842 items.equalizeHeights(resizeOptions.outer, classNull, resizeOptions); 3843 } 3844 i += slice || 1; 3845 } 3846 } 3847 } 3848 } 3849 if (resizeOptions.lineheight) { 3850 var lineheightAdd = parseInt(resizeOptions.lineheight); 3851 if (isNaN(lineheightAdd)) { 3852 lineheightAdd = 0; 3853 } 3854 el.each(function () { 3855 $(this).css("line-height", $(this).actual("height") + lineheightAdd + "px"); 3856 }); 3857 } 3858 } 3859 } 3860 var options = $.extend( 3861 { 3862 slice: null, 3863 sliceNext: null, 3864 outer: false, 3865 lineheight: false, 3866 autoslicecount: true, 3867 classNull: false, 3868 minHeight: false, 3869 row: false, 3870 item: false, 3871 typeResize: false, 3872 typeValue: false, 3873 fixWidth: 0, 3874 resize: true, 3875 mobile: false, 3876 customSlice: false, 3877 breakpoint: {}, 3878 classes: [], 3879 }, 3880 options 3881 ); 3882 3883 var el = $(this); 3884 3885 ignoreResize.push(true); 3886 _slice(el); 3887 ignoreResize.pop(); 3888 3889 if (options.resize) { 3890 BX.addCustomEvent("onWindowResize", function (eventdata) { 3891 try { 3892 ignoreResize.push(true); 3893 _slice(el); 3894 } catch (e) { 3895 } finally { 3896 ignoreResize.pop(); 3897 } 3898 }); 3899 } else { 3900 if (!ignoreResize.length) { 3901 // ignoreResize.push(true); 3902 _slice(el); 3903 // ignoreResize.pop(); 3904 } 3905 } 3906}; 3907 3908$.fn.sliceHeightNoResize = function (options) { 3909 function _slice(el) { 3910 el.each(function () { 3911 $(this).css("line-height", ""); 3912 $(this).css("height", ""); 3913 }); 3914 if (options.mobile == true) { 3915 if (window.matchMedia("(max-width: 550px)").matches) return; 3916 } 3917 if (typeof options.autoslicecount == "undefined" || options.autoslicecount !== false) { 3918 var elsw = 3919 typeof options.row !== "undefined" && options.row.length 3920 ? el.first().parents(options.row).getFloatWidth() 3921 : el.first().parents(".items").getFloatWidth(), 3922 elw = 3923 typeof options.item !== "undefined" && options.item.length 3924 ? $(options.item).first().getFloatWidth() 3925 : el.first().hasClass("item") 3926 ? el.first().getFloatWidth() 3927 : el.first().parents(".item").getFloatWidth(); 3928 3929 if (!elsw) { 3930 elsw = el.first().parents(".row").getFloatWidth(); 3931 } 3932 if (elw && options.fixWidth) elw -= options.fixWidth; 3933 3934 if (elsw && elw) { 3935 options.slice = Math.floor(elsw / elw); 3936 } 3937 } 3938 if (options.customSlice) { 3939 //manual slice count 3940 var arBreakpoints = Object.keys(options.breakpoint),
3941 bSliceNext = false; 3942 if (arBreakpoints.length) { 3943 elw = 3944 typeof options.item !== "undefined" && options.item.length 3945 ? $(options.item).last().getFloatWidth() 3946 : el.last().hasClass("item") 3947 ? el.last().getFloatWidth() 3948 : el.last().parents(".item").getFloatWidth(); 3949 if (elw) options.sliceNext = Math.floor(elsw / elw); 3950 for (var key in arBreakpoints) { 3951 if (window.matchMedia(arBreakpoints[key].toString()).matches) { 3952 bSliceNext = true; 3953 options.slice = options.breakpoint[arBreakpoints[key]]; 3954 } 3955 } 3956 } 3957 } 3958 if (typeof options.typeResize == "undefined" || options.typeResize == false) { 3959 if (options.slice) { 3960 for (var i = 0; i < el.length; i += options.slice) { 3961 if (options.customSlice && options.sliceNext && bSliceNext && i) 3962 //manual slice count 3963 options.slice = options.sliceNext; 3964 $(el.slice(i, i + options.slice)).equalizeHeights( 3965 options.outer, 3966 options.classNull, 3967 options.minHeight, 3968 options.typeResize, 3969 options.typeValue 3970 ); 3971 } 3972 } 3973 if (options.lineheight) { 3974 var lineheightAdd = parseInt(options.lineheight); 3975 if (isNaN(lineheightAdd)) { 3976 lineheightAdd = 0; 3977 } 3978 el.each(function () { 3979 $(this).css("line-height", $(this).actual("height") + lineheightAdd + "px"); 3980 }); 3981 } 3982 } 3983 } 3984 var options = $.extend( 3985 { 3986 slice: null, 3987 sliceNext: null, 3988 outer: false, 3989 lineheight: false, 3990 autoslicecount: true, 3991 classNull: false, 3992 minHeight: false, 3993 row: false, 3994 item: false, 3995 typeResize: false, 3996 typeValue: false, 3997 fixWidth: 0, 3998 resize: true, 3999 mobile: false, 4000 customSlice: false, 4001 breakpoint: {}, 4002 }, 4003 options 4004 ); 4005 4006 var el = $(this); 4007 4008 ignoreResize.push(true); 4009 _slice(el); 4010 ignoreResize.pop(); 4011}; 4012 4013if (!funcDefined("initHoverBlock")) { 4014 function initHoverBlock(target) {} 4015} 4016if (!funcDefined("setStatusButton")) { 4017 function setStatusButton() { 4018 if (!funcDefined("setItemButtonStatus")) { 4019 setItemButtonStatus = function (data) { 4020 if (data.BASKET) { 4021 for (var i in data.BASKET) { 4022 var id = data.BASKET[i]; 4023 if (typeof id === "number" || typeof id === "string") { 4024 $(".to-cart[data-item=" + id + "]").hide(); 4025 $(".counter_block[data-item=" + id + "]") 4026 .closest(".counter_block_inner") 4027 .hide(); 4028 $(".counter_block[data-item=" + id + "]").hide(); 4029 $(".in-cart[data-item=" + id + "]").show(); 4030 $(".in-cart[data-item=" + id + "]") 4031 .closest(".button_block") 4032 .addClass("wide"); 4033 } 4034 } 4035 } 4036 if (data.SUBSCRIBE) { 4037 for (var i in data.SUBSCRIBE) { 4038 var id = data.SUBSCRIBE[i]; 4039 if (typeof id === "number" || typeof id === "string") { 4040 $(".to-subscribe[data-item=" + id + "]").hide(); 4041 $(".in-subscribe[data-item=" + id + "]").show(); 4042 } 4043 } 4044 } 4045 4046 BX.onCustomEvent("onSetItemButtonStatus", []); 4047 }; 4048 } 4049 if (!Object.keys(arStatusBasketAspro).length) { 4050 if (typeof arAsproOptions === "undefined") { 4051 var arAsproOptions = { 4052 SITE_DIR: "/", 4053 }; 4054 if ($("body").data("site") !== undefined) arAsproOptions["SITE_DIR"] = $("body").data("site"); 4055 } 4056 $.ajax({ 4057 url: arAsproOptions["SITE_DIR"] + "ajax/getAjaxBasket.php", 4058 type: "POST", 4059 success: function (data) { 4060 arStatusBasketAspro = data; 4061 setItemButtonStatus(arStatusBasketAspro); 4062 }, 4063 }); 4064 } else setItemButtonStatus(arStatusBasketAspro); 4065 } 4066} 4067 4068if (!funcDefined("onLoadjqm")) { 4069 var onLoadjqm = function (name, hash, requestData, selector, requestTitle, isButton, thButton) { 4070 hash.w.attr("data-jqm-loaded", "1"); 4071 4072 if (hash.c.noOverlay === undefined || (hash.c.noOverlay !== undefined && !hash.c.noOverlay)) { 4073 $("body").addClass("jqm-initied"); 4074 } 4075 if (window.matchMedia("(min-width: 768px)").matches) { 4076 $("body").addClass("swipeignore"); 4077 } 4078 4079 //show password eye 4080 if (hash.w.hasClass("auth_frame")) { 4081 hash.w.find(".form-control:not(.eye-password-ignore) [type=password]").each(function (item) { 4082 $(this).closest(".form-control").addClass("eye-password"); 4083 }); 4084 } 4085 4086 $.each($(hash.t).get(0).attributes, function (index, attr) { 4087 if (/^data\-autoload\-(.+)$/.test(attr.nodeName)) { 4088 var key = attr.nodeName.match(/^data\-autoload\-(.+)$/)[1]; 4089 var el = $('input[data-sid="' + key.toUpperCase() + '"]'); 4090 var value = $(hash.t).data("autoload-" + key);
4091 value = String(value).replace(/%99/g, "\\"); // replace symbol \ 4092 el.val(BX.util.htmlspecialcharsback(value)).attr("readonly", "readonly"); 4093 el.closest(".form-group").addClass("input-filed"); 4094 el.attr("title", el.val()); 4095 } 4096 }); 4097 4098 //show gift block 4099 if (hash.w.hasClass("send_gift_frame")) { 4100 var imgHtml = (priceHtml = propsHtml = ""); 4101 if ($(".offers_img a").length) imgHtml = $(".offers_img a").html(); 4102 else if ($(".product-detail-gallery__container .first_sku_picture").length) 4103 imgHtml = "<img src=" + $(".product-detail-gallery__container link.first_sku_picture").attr("href") + " />"; 4104 else if ($(".product-detail-gallery__container").length) 4105 imgHtml = "<img src=" + $('.product-detail-gallery__container link[itemprop="image"]').attr("href") + " />"; 4106 4107 if ($('.product-container *[itemprop="offers"]').length) { 4108 //show price 4109 if ($(".sku-view").length) { 4110 if ($(".prices_block .price").length) 4111 priceHtml = $(".prices_block .cost.prices").html().replace("id", "data-id"); 4112 } else { 4113 var mainContainer = $(hash.t).closest(".product-main"); 4114 if (mainContainer.find(".prices_block .js_price_wrapper").length) { 4115 if (mainContainer.find(".prices_block .js_price_wrapper .with_matrix").length) { 4116 priceHtml = 4117 '<div class="with_matrix">' + 4118 mainContainer.find(".prices_block .js_price_wrapper .with_matrix").html() + 4119 "</div>"; 4120 } else if (mainContainer.find(".prices_block .with_matrix:visible").length) { 4121 priceHtml = 4122 '<div class="with_matrix">' + mainContainer.find(".prices_block .with_matrix").html() + "</div>"; 4123 } else if (mainContainer.find(".prices_block .price_group.min").length) { 4124 priceHtml = 4125 '<div class="with_matrix">' + mainContainer.find(".prices_block .price_group.min").html() + "</div>"; 4126 } else { 4127 priceHtml = 4128 '<div class="with_matrix">' + mainContainer.find(".prices_block .js_price_wrapper").html() + "</div>"; 4129 } 4130 } else if (mainContainer.find(".prices_block .with_matrix").length) 4131 priceHtml = 4132 '<div class="with_matrix">' + mainContainer.find(".prices_block .with_matrix").html() + "</div>"; 4133 else if (mainContainer.find(".prices_block .price_group.min").length) 4134 priceHtml = mainContainer.find(".prices_block .price_group.min").html(); 4135 else if (mainContainer.find(".prices_block .price_matrix_wrapper").length) 4136 priceHtml = mainContainer.find(".prices_block .price_matrix_wrapper").html(); 4137 } 4138 } 4139 4140 if ($(".buy_block .sku_props").length) { 4141 propsHtml = '<div class="props_item">'; 4142 $(".buy_block .sku_props .bx_catalog_item_scu > div").each(function () { 4143 var title = $(this).find(".bx_item_section_name > span").html(); 4144 var props = ""; 4145 var ikSelect = $(this).find(".ik_select_link_text"); 4146 if (ikSelect.length) { 4147 props = ikSelect.text(); 4148 } else { 4149 var activeSku = $(this).find("ul li.active"); 4150 var isPicture = activeSku.find(" > i"); 4151 if (isPicture.length && isPicture.attr("title")) { 4152 var propTitle = isPicture.attr("title").split(":"); 4153 if (propTitle.length) { 4154 propTitle = propTitle[1].trim(); 4155 } else { 4156 propTitle = isPicture.attr("title"); 4157 } 4158 props = propTitle; 4159 } else { 4160 props = activeSku.find(" > span").text(); 4161 } 4162 } 4163 4164 propsHtml += 4165 '<div class="prop_item">' + 4166 "<span>" + 4167 title + 4168 // '<span class="val">' + 4169 // props + 4170 // "</span>" + 4171 "</span>" + 4172 "</div>"; 4173 }); 4174 propsHtml += "</div>"; 4175 } 4176 $( 4177 '<div class="custom_block">' + 4178 '<div class="title">' + 4179 BX.message("POPUP_GIFT_TEXT") + 4180 "</div>" + 4181 '<div class="item_block">' + 4182 '<table class="item_list"><tr>' + 4183 '<td class="image">' + 4184 "<div>" + 4185 imgHtml + 4186 "</div>" + 4187 "</td>" + 4188 '<td class="text">' + 4189 '<div class="name">' + 4190 $("h1").text() + 4191 "</div>" + 4192 priceHtml + 4193 propsHtml + 4194 "</td>" + 4195 "</tr></table>" + 4196 "</div>" + 4197 "</div>" 4198 ).prependTo(hash.w.find(".form_body")); 4199 } 4200 4201 if ( 4202 arAsproOptions["THEME"]["REGIONALITY_SEARCH_ROW"] == "Y" && 4203 (hash.w.hasClass("city_chooser_frame") || hash.w.hasClass("city_chooser_small_frame")) 4204 ) {
4205 hash.w.addClass("small_popup_regions"); 4206 hash.w.addClass("no_scroll"); 4207 } 4208 4209 if (name == "fast_view" && $(".smart-filter-filter").length) { 4210 var navButtons = 4211 '<div class="navigation-wrapper-fast-view">' + 4212 '<div class="fast-view-nav prev colored_theme_hover_bg" data-fast-nav="prev">' + 4213 '<i class="svg left">' + 4214 '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6.969" viewBox="0 0 12 6.969"><path id="Rounded_Rectangle_702_copy_24" data-name="Rounded Rectangle 702 copy 24" class="cls-1" d="M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z" transform="translate(-350 -395.031)"/></svg>' + 4215 "</i>" + 4216 "</div>" + 4217 '<div class="fast-view-nav next colored_theme_hover_bg" data-fast-nav="next">' + 4218 '<i class="svg right">' + 4219 '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6.969" viewBox="0 0 12 6.969"><path id="Rounded_Rectangle_702_copy_24" data-name="Rounded Rectangle 702 copy 24" class="cls-1" d="M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z" transform="translate(-350 -395.031)"/></svg>' + 4220 "</i>" + 4221 "</div>" + 4222 "</div>"; 4223 4224 hash.w.closest("#popup_iframe_wrapper").append(navButtons); 4225 } 4226 4227 hash.w.addClass("scrollblock"); 4228 hash.w.addClass("show").css({ 4229 // 'top': (($(window).height() > hash.w.height()) ? Math.floor(($(window).height() - hash.w.height()) / 2) : 0) + 'px', 4230 // 'margin-left': ($(window).width() > hash.w.outerWidth() ? '-' + hash.w.outerWidth() / 2 + 'px' : '-' + $(window).width() / 2 + 'px'), 4231 opacity: 1, 4232 }); 4233 4234 if (hash.c.noOverlay === undefined || (hash.c.noOverlay !== undefined && !hash.c.noOverlay)) { 4235 let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth + "px"; 4236 $("body").css({ 4237 "padding-right": scrollbarWidth, 4238 overflow: "hidden", 4239 height: "100vh", 4240 }); 4241 hash.w.closest("#popup_iframe_wrapper").css({ "z-index": 3000, display: "flex" }); 4242 } 4243 4244 if (hash.c.noOverlay !== undefined && hash.c.noOverlay) { 4245 hash.w.closest("#body_iframe_wrapper").css({ "z-index": 2999, display: "flex" }); 4246 } 4247 4248 var eventdata = { action: "loadForm" }; 4249 let _this = $(hash.t)[0]; 4250 if (thButton) { 4251 _this = thButton; 4252 } 4253 BX.onCustomEvent("onCompleteAction", [eventdata, _this]); 4254 4255 if (typeof requestData == "undefined") { 4256 requestData = ""; 4257 } 4258 if (typeof selector == "undefined") { 4259 selector = false; 4260 } 4261 4262 // var width = $("." + name + "_frame").width(); 4263 //$('.'+name+'_frame').css('margin-left', '-'+width/2+'px'); 4264 4265 if (name == "order-popup-call") { 4266 } else if (name == "order-button") { 4267 $(".order-button_frame") 4268 .find("div[product_name]") 4269 .find("input") 4270 .val(hash.t.title) 4271 .attr("readonly", "readonly") 4272 .css({ overflow: "hidden", "text-overflow": "ellipsis" }); 4273 } else if (name == "basket_error") { 4274 $(".basket_error_frame .pop-up-title").text(requestTitle); 4275 $(".basket_error_frame .ajax_text").html(requestData); 4276 4277 if (window.matchMedia("(max-width: 991px)").matches) { 4278 $("body").addClass("all_viewed"); 4279 } 4280 4281 initSelects(document); 4282 if (isButton == "Y" && thButton) 4283 $( 4284 "<div class='popup_button_basket_wr'><span class='popup_button_basket big_btn button' data-item=" + 4285 thButton.data("item") + 4286 "><span class='btn btn-default'>" + 4287 BX.message("ERROR_BASKET_BUTTON") + 4288 "</span></span></div>" 4289 ).insertAfter($(".basket_error_frame .ajax_text")); 4290 } else if (name === "fast_view") { 4291 initSelects(document); 4292 } 4293 4294 $("." + name + "_frame").show(); 4295 }; 4296} 4297 4298if (!funcDefined("onHidejqm")) { 4299 var onHidejqm = function (name, hash) { 4300 if (hash.w.find(".one_click_buy_result_success").is(":visible") && name == "one_click_buy_basket") { 4301 window.location.href = window.location.href; 4302 } 4303 4304 if ($(".xzoom-source").length) $(".xzoom-source").remove(); 4305 if ($(".xzoom-preview").length) $(".xzoom-preview").remove(); 4306 4307 // hash.w.css('opacity', 0).hide(); 4308 hash.w.animate({ opacity: 0 }, 200, function () { 4309 hash.w.hide(); 4310 hash.w.empty(); 4311 hash.o.remove(); 4312 hash.w.removeClass("show"); 4313 4314 if (!hash.w.closest("#popup_iframe_wrapper").find(".jqmOverlay").length) { 4315 $("body").css({ 4316 "padding-right": "", 4317 overflow: "", 4318 height: "", 4319 }); 4320 hash.w.closest("#popup_iframe_wrapper").css({ "z-index": "", display: "" }); 4321 } 4322 4323 if (!hash.w.closest("#body_iframe_wrapper").find(".jqmWindow.show").length) { 4324 hash.w.closest("#body_iframe_wrapper").css({ "z-index": "", display: "" }); 4325 } 4326 4327 if (window.matchMedia("(max-width: 991px)").matches) { 4328 $("body").removeClass("all_viewed"); 4329 } 4330 if (!$(".jqmOverlay:not(.mobp)").length || $(".jqmOverlay.waiting").length) { 4331 $("body").removeClass("jqm-initied"); 4332 } 4333 4334 if (window.matchMedia("(min-width: 768px)").matches) { 4335 $("body").removeClass("swipeignore"); 4336 } 4337 4338 if (name == "fast_view") { 4339 $(".fast_view_popup").remove(); 4340 4341 var navButtons = hash.w.closest("#popup_iframe_wrapper").find(".navigation-wrapper-fast-view"); 4342 navButtons.remove(); 4343 } 4344 }); 4345 4346 // window.b24form = false;
4347 4348 // hide bx calc 4349 let items = document.querySelectorAll(".bx-calendar"); 4350 if (items) { 4351 items.forEach((item) => { 4352 item.closest(".popup-window").style.display = "none"; 4353 }); 4354 } 4355 }; 4356} 4357 4358$.fn.jqmEx = function () { 4359 // $(this).each(function(){ 4360 var _this = $(this); 4361 var name = _this.data("name"); 4362 4363 if (name.length && _this.attr("disabled") != "disabled") { 4364 var extClass = "", 4365 paramsStr = "", 4366 trigger = ""; 4367 4368 // call counter 4369 if (typeof $.fn.jqmEx.counter === "undefined") { 4370 $.fn.jqmEx.counter = 0; 4371 } else { 4372 ++$.fn.jqmEx.counter; 4373 } 4374 4375 // trigger attrs and params 4376 $.each(_this.get(0).attributes, function (index, attr) { 4377 var attrName = attr.nodeName; 4378 var attrValue = _this.attr(attrName); 4379 if (attrName !== "onclick") { 4380 trigger += "[" + attrName + '="' + attrValue + '"]'; 4381 } 4382 if (/^data\-param\-(.+)$/.test(attrName)) { 4383 var key = attrName.match(/^data\-param\-(.+)$/)[1]; 4384 paramsStr += key + "=" + attrValue + "&"; 4385 } 4386 }); 4387 4388 // popup url 4389 var script = arAsproOptions["SITE_DIR"] + "ajax/form.php"; 4390 if (name == "auth") { 4391 script += "?" + paramsStr + "auth=Y"; 4392 } else { 4393 script += "?" + paramsStr; 4394 } 4395 4396 // ext frame class 4397 if (_this.closest("#fast_view_item").length) { 4398 extClass = "fast_view_popup"; 4399 } 4400 4401 // use overlay? 4402 var noOverlay = _this.data("noOverlay") == "Y"; 4403 4404 // unique frame to each trigger 4405 if (noOverlay) { 4406 var frame = $( 4407 '<div class="' + 4408 name + 4409 "_frame " + 4410 extClass + 4411 ' jqmWindow popup" data-popup="' + 4412 $.fn.jqmEx.counter + 4413 '"></div>' 4414 ).appendTo("#body_iframe_wrapper"); 4415 } else { 4416 var frame = $( 4417 '<div class="' + 4418 name + 4419 "_frame " + 4420 extClass + 4421 ' jqmWindow popup" data-popup="' + 4422 $.fn.jqmEx.counter + 4423 '"></div>' 4424 ).appendTo("#popup_iframe_wrapper"); 4425 } 4426 4427 let overlayClass = "jqmOverlay"; 4428 if (_this.data("jqm-overlay-class")) { 4429 overlayClass += " " + _this.data("jqm-overlay-class"); 4430 } 4431 4432 loadJQM(() => { 4433 if (frame.attr("data-jqm-loaded") === "1") { 4434 return; 4435 } 4436 frame.jqm({ 4437 ajax: script, 4438 trigger: trigger, 4439 noOverlay: noOverlay, 4440 overlayClass: overlayClass, 4441 onLoad: function (hash) { 4442 onLoadjqm(name, hash); 4443 }, 4444 onHide: function (hash) { 4445 if (hash.w.hasClass("jqm-lock-close")) { 4446 return false; 4447 } 4448 onHidejqm(name, hash); 4449 }, 4450 }); 4451 _this.trigger("click"); 4452 }); 4453 } 4454 // }); 4455}; 4456 4457window.addEventListener("keydown", function (e) { 4458 if (e.keyCode == 27) { 4459 let jqmPopup = $(".jqm-init.show").last(); 4460 if (!jqmPopup.hasClass("jqm-lock-close")) { 4461 jqmPopup.jqmHide(); 4462 } 4463 4464 // hide fixed search panel with overlay 4465 if ($(".inline-search-block.show").length) { 4466 $(".inline-search-block").toggleClass("show"); 4467 $(".jqmOverlay.search").detach(); 4468 } 4469 4470 // hide already visible search results 4471 $(".title-search-result").hide(); 4472 4473 // unfocus title.search input 4474 $(".search .search-input").trigger("blur"); 4475 4476 $(".mega_fixed_menu").fadeOut(animationTime); 4477 } 4478}); 4479 4480if (!funcDefined("scroll_block")) { 4481 function scroll_block(block, clickedItem) { 4482 if (block.length) { 4483 if (clickedItem !== undefined && clickedItem.length) { 4484 clickedItem.trigger("click"); 4485 } else { 4486 $(".prices_tab").addClass("active").siblings().removeClass("active"); 4487 if ($(".prices_tab .opener").length && !$(".prices_tab .opener .opened").length) { 4488 let item = $(".prices_tab .opener").first(); 4489 item.find(".opener_icon").addClass("opened"); 4490 item.parents("tr").addClass("nb"); 4491 item.parents("tr").next(".offer_stores").find(".stores_block_wrap").slideDown(200); 4492 } 4493 } 4494 let topPos = block.offset().top, 4495 headerOffsetTop = $("#headerfixed").lenght ? $("#headerfixed").outerHeight(true, true) : 0; 4496 4497 let $tabFixed = document.querySelector(".product-item-detail-tabs-container-fixed"); 4498 if ($tabFixed) { 4499 topPos -= $tabFixed.offsetHeight; 4500 } 4501 $("html,body").animate({ scrollTop: topPos - headerOffsetTop }, 150); 4502 } 4503 } 4504} 4505 4506if (!funcDefined("jqmEd")) { 4507 var jqmEd = function (name, form_id, open_trigger, requestData, selector, requestTitle, isButton, thButton) { 4508 if (typeof requestData == "undefined") { 4509 requestData = ""; 4510 } 4511 if (typeof selector == "undefined") { 4512 selector = false;
4513 } 4514 $("body #popup_iframe_wrapper") 4515 .find("." + name + "_frame") 4516 .remove(); 4517 $("body #popup_iframe_wrapper").append('<div class="' + name + '_frame jqmWindow popup"></div>'); 4518 4519 loadJQM(() => { 4520 if (typeof open_trigger == "undefined") { 4521 $("." + name + "_frame").jqm({ 4522 trigger: "." + name + "_frame.popup", 4523 onHide: function (hash) { 4524 onHidejqm(name, hash); 4525 }, 4526 onLoad: function (hash) { 4527 onLoadjqm(name, hash, requestData, selector); 4528 }, 4529 ajax: 4530 arAsproOptions["SITE_DIR"] + 4531 "ajax/form.php?form_id=" + 4532 form_id + 4533 (requestData.length ? "&" + requestData : ""), 4534 }); 4535 } else { 4536 if (name == "enter") { 4537 $("." + name + "_frame").jqm({ 4538 trigger: open_trigger, 4539 onHide: function (hash) { 4540 onHidejqm(name, hash); 4541 }, 4542 onLoad: function (hash) { 4543 onLoadjqm(name, hash, requestData, selector); 4544 }, 4545 ajax: arAsproOptions["SITE_DIR"] + "ajax/auth.php", 4546 }); 4547 } else if (name == "basket_error") { 4548 $("." + name + "_frame").jqm({ 4549 trigger: open_trigger, 4550 onHide: function (hash) { 4551 onHidejqm(name, hash); 4552 }, 4553 onLoad: function (hash) { 4554 onLoadjqm(name, hash, requestData, selector, requestTitle, isButton, thButton); 4555 }, 4556 ajax: arAsproOptions["SITE_DIR"] + "ajax/basket_error.php", 4557 }); 4558 } else { 4559 $("." + name + "_frame").jqm({ 4560 trigger: open_trigger, 4561 onHide: function (hash) { 4562 onHidejqm(name, hash); 4563 }, 4564 onLoad: function (hash) { 4565 onLoadjqm(name, hash, requestData, selector); 4566 }, 4567 ajax: 4568 arAsproOptions["SITE_DIR"] + 4569 "ajax/form.php?form_id=" + 4570 form_id + 4571 (requestData.length ? "&" + requestData : ""), 4572 }); 4573 } 4574 $(open_trigger).dblclick(function () { 4575 return false; 4576 }); 4577 } 4578 4579 $(open_trigger).click(); 4580 $(open_trigger).remove(); 4581 }); 4582 return true; 4583 }; 4584} 4585 4586if (!funcDefined("replaceBasketPopup")) { 4587 function replaceBasketPopup(hash) { 4588 if (typeof hash != "undefined") { 4589 hash.w.hide(); 4590 hash.o.hide(); 4591 } 4592 } 4593} 4594 4595if (!funcDefined("waitLayer")) { 4596 function waitLayer(delay, callback) { 4597 if (typeof dataLayer !== "undefined" && typeof callback === "function") { 4598 callback(); 4599 } else { 4600 setTimeout(function () { 4601 waitLayer(delay, callback); 4602 }, delay); 4603 } 4604 } 4605} 4606 4607if (!funcDefined("checkCounters")) { 4608 function checkCounters(name) { 4609 if (typeof name !== "undefined") { 4610 if ( 4611 name == "google" && 4612 arAsproOptions["COUNTERS"]["GOOGLE_ECOMERCE"] == "Y" && 4613 arAsproOptions["COUNTERS"]["GOOGLE_COUNTER"] > 0 4614 ) { 4615 return true; 4616 } else if ( 4617 name == "yandex" && 4618 arAsproOptions["COUNTERS"]["YANDEX_ECOMERCE"] == "Y" && 4619 arAsproOptions["COUNTERS"]["YANDEX_COUNTER"] > 0 4620 ) { 4621 return true; 4622 } else { 4623 return false; 4624 } 4625 } else if ( 4626 (arAsproOptions["COUNTERS"]["YANDEX_ECOMERCE"] == "Y" && arAsproOptions["COUNTERS"]["YANDEX_COUNTER"] > 0) || 4627 (arAsproOptions["COUNTERS"]["GOOGLE_ECOMERCE"] == "Y" && arAsproOptions["COUNTERS"]["GOOGLE_COUNTER"] > 0) 4628 ) { 4629 return true; 4630 } else { 4631 return false; 4632 } 4633 } 4634} 4635 4636if (!funcDefined("addBasketCounter")) { 4637 function addBasketCounter(id) { 4638 if (arAsproOptions["COUNTERS"]["USE_BASKET_GOALS"] !== "N") { 4639 var eventdata = { goal: "goal_basket_add", params: { id: id } }; 4640 BX.onCustomEvent("onCounterGoals", [eventdata]); 4641 } 4642 if (checkCounters()) { 4643 $.ajax({ 4644 url: arAsproOptions["SITE_DIR"] + "ajax/goals.php", 4645 dataType: "json", 4646 type: "POST", 4647 data: { ID: id }, 4648 success: function (item) { 4649 if (!!item && !!item.ID) { 4650 let ecommerce = { 4651 items: [ 4652 { 4653 item_name: item.NAME, // Name or ID is required. 4654 item_id: item.ID, 4655 price: parseFloat(item.PRICE), 4656 item_brand: item.BRAND, 4657 item_category: item.CATEGORY, 4658 item_list_name: "List Results", 4659 item_list_id: item.IBLOCK_SECTION_ID, 4660 affiliation: item.SHOP_NAME, 4661 index: 1, 4662 quantity: parseFloat(item.QUANTITY), 4663 }, 4664 ], 4665 }; 4666 if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") { 4667 ecommerce = { 4668 currencyCode: item.CURRENCY, 4669 add: { 4670 products: [ 4671 { 4672 id: item.ID, 4673 name: item.NAME, 4674 price: parseFloat(item.PRICE), 4675 brand: item.BRAND, 4676 category: item.CATEGORY, 4677 quantity: parseFloat(item.QUANTITY), 4678 }, 4679 ], 4680 }, 4681 }; 4682 } 4683 waitLayer(100, function () { 4684 dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. 4685 dataLayer.push({ 4686 // event: 'add_to_cart', 4687 event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["ADD2BASKET"], 4688 currency: item.CURRENCY, 4689 value: parseFloat(item.PRICE), 4690 ecommerce: ecommerce, 4691 }); 4692 }); 4693 } 4694 }, 4695 }); 4696 } 4697 } 4698} 4699 4700if (!funcDefined("purchaseCounter")) { 4701 function purchaseCounter(order_id, type, callback) { 4702 if (checkCounters()) { 4703 $.ajax({ 4704 url: arAsproOptions["SITE_DIR"] + "ajax/goals.php", 4705 dataType: "json", 4706 type: "POST", 4707 data: { ORDER_ID: order_id, TYPE: type }, 4708 success: function (order) { 4709 var products = []; 4710 const items = []; 4711 if (order.ITEMS) { 4712 for (var i in order.ITEMS) { 4713 products.push({ 4714 id: order.ITEMS[i].ID, 4715 sku: order.ITEMS[i].ID, 4716 name: order.ITEMS[i].NAME, 4717 price: order.ITEMS[i].PRICE, 4718 brand: order.ITEMS[i].BRAND, 4719 category: order.ITEMS[i].CATEGORY, 4720 quantity: order.ITEMS[i].QUANTITY, 4721 }); 4722 items.push({ 4723 item_id: order.ITEMS[i].ID, 4724 item_name: order.ITEMS[i].NAME, 4725 price: parseFloat(order.ITEMS[i].PRICE), 4726 item_brand: order.ITEMS[i].BRAND, 4727 item_category: order.ITEMS[i].CATEGORY, 4728 affiliation: order.SHOP_NAME, 4729 quantity: parseFloat(order.ITEMS[i].QUANTITY), 4730 }); 4731 } 4732 } 4733 if (order.ID) { 4734 let ecommerce = { 4735 transaction_id: order.ACCOUNT_NUMBER, 4736 affiliation: order.SHOP_NAME, 4737 value: order.PRICE, 4738 tax: order.TAX_VALUE, 4739 shipping: order.PRICE_DELIVERY, 4740 currency: order.CURRENCY, 4741 items: items, 4742 }; 4743 if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") { 4744 ecommerce = { 4745 purchase: { 4746 actionField: { 4747 id: order.ACCOUNT_NUMBER, 4748 shipping: order.PRICE_DELIVERY, 4749 tax: order.TAX_VALUE, 4750 list: type, 4751 revenue: order.PRICE, 4752 }, 4753 products: products, 4754 }, 4755 }; 4756 } 4757 waitLayer(100, function () { 4758 dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. 4759 dataLayer.push({ 4760 event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["PURCHASE"], 4761 ecommerce: ecommerce, 4762 }); 4763 4764 if (typeof callback !== "undefined") { 4765 callback(ecommerce); 4766 } 4767 }); 4768 } else { 4769 if (typeof callback !== "undefined") { 4770 callback(); 4771 } 4772 } 4773 }, 4774 error: function () { 4775 if (typeof callback !== "undefined") { 4776 callback(); 4777 } 4778 }, 4779 }); 4780 } 4781 } 4782} 4783 4784if (!funcDefined("viewItemCounter")) { 4785 function viewItemCounter(id, price_id) { 4786 if (checkCounters()) { 4787 $.ajax({ 4788 url: arAsproOptions["SITE_DIR"] + "ajax/goals.php", 4789 dataType: "json", 4790 type: "POST", 4791 data: { PRODUCT_ID: id, PRICE_ID: price_id }, 4792 success: function (item) { 4793 if (item.ID) { 4794 let ecommerce = { 4795 items: [ 4796 { 4797 item_name: item.NAME, // Name or ID is required. 4798 item_id: item.ID, 4799 price: parseFloat(item.PRICE), 4800 item_brand: item.BRAND, 4801 item_category: item.CATEGORY, 4802 item_list_name: "List Results", 4803 item_list_id: item.IBLOCK_SECTION_ID, 4804 affiliation: item.SHOP_NAME, 4805 index: 1, 4806 quantity: parseFloat(item.QUANTITY), 4807 }, 4808 ], 4809 }; 4810 if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") { 4811 ecommerce = { 4812 detail: { 4813 products: [ 4814 { 4815 id: item.ID, 4816 name: item.NAME, 4817 price: parseFloat(item.PRICE), 4818 brand: item.BRAND, 4819 category: item.CATEGORY, 4820 }, 4821 ], 4822 }, 4823 }; 4824 } 4825 waitLayer(100, function () { 4826 dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. 4827 dataLayer.push({ 4828 event: "view_item", 4829 currency: item.CURRENCY, 4830 value: parseFloat(item.PRICE), 4831 ecommerce: ecommerce, 4832 }); 4833 }); 4834 } 4835 }, 4836 }); 4837 } 4838 } 4839} 4840 4841if (!funcDefined("checkoutCounter")) { 4842 function checkoutCounter(step, option, callback) { 4843 if (checkCounters("google")) { 4844 $.ajax({ 4845 url: arAsproOptions["SITE_DIR"] + "ajax/goals.php", 4846 dataType: "json", 4847 type: "POST", 4848 data: { BASKET: "Y" }, 4849 success: function (basket) { 4850 var products = []; 4851 const items = []; 4852 let summ = 0; 4853 let currency = "RUB"; 4854 if (basket.ITEMS) { 4855 for (var i in basket.ITEMS) { 4856 products.push({ 4857 id: basket.ITEMS[i].ID, 4858 name: basket.ITEMS[i].NAME, 4859 price: basket.ITEMS[i].PRICE, 4860 brand: basket.ITEMS[i].BRAND, 4861 category: basket.ITEMS[i].CATEGORY, 4862 quantity: basket.ITEMS[i].QUANTITY, 4863 }); 4864 items.push({ 4865 item_id: basket.ITEMS[i].ID, 4866 item_name: basket.ITEMS[i].NAME, 4867 price: parseFloat(basket.ITEMS[i].PRICE), 4868 item_brand: basket.ITEMS[i].BRAND, 4869 item_category: basket.ITEMS[i].CATEGORY, 4870 affiliation: basket.SHOP_NAME, 4871 quantity: parseFloat(basket.ITEMS[i].QUANTITY), 4872 }); 4873 summ += basket.ITEMS[i].PRICE; 4874 currency = basket.ITEMS[i].CURRENCY; 4875 } 4876 } 4877 if (products) { 4878 let ecommerce = { 4879 items: items, 4880 }; 4881 if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") { 4882 ecommerce = { 4883 checkout: { 4884 actionField: { 4885 step: step, 4886 option: option, 4887 }, 4888 products: products, 4889 }, 4890 }; 4891 } 4892 waitLayer(100, function () { 4893 dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. 4894 dataLayer.push({ 4895 event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["CHECKOUT_ORDER"], 4896 currency: currency, 4897 value: parseFloat(summ), 4898 ecommerce: ecommerce, 4899 }); 4900 if (typeof callback !== "undefined" && typeof callback === "function") { 4901 callback(); 4902 } 4903 }); 4904 } 4905 }, 4906 }); 4907 } 4908 } 4909} 4910 4911if (!funcDefined("delFromBasketCounter")) { 4912 function delFromBasketCounter(id, callback) { 4913 if (checkCounters()) { 4914 $.ajax({ 4915 url: arAsproOptions["SITE_DIR"] + "ajax/goals.php", 4916 dataType: "json", 4917 type: "POST", 4918 data: { ID: id }, 4919 success: function (item) { 4920 if (item.ID) { 4921 let ecommerce = { 4922 items: [ 4923 { 4924 item_name: item.NAME, // Name or ID is required. 4925 item_id: item.ID, 4926 price: parseFloat(item.PRICE), 4927 item_brand: item.BRAND, 4928 item_category: item.CATEGORY, 4929 affiliation: item.SHOP_NAME, 4930 item_list_name: "List Results", 4931 }, 4932 ], 4933 }; 4934 if (arAsproOptions["COUNTERS"]["GA_VERSION"] === "v3") { 4935 ecommerce = { 4936 remove: { 4937 products: [ 4938 { 4939 id: item.ID, 4940 name: item.NAME, 4941 category: item.CATEGORY, 4942 }, 4943 ], 4944 }, 4945 }; 4946 } 4947 waitLayer(100, function () { 4948 dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object. 4949 dataLayer.push({ 4950 event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["REMOVE_BASKET"], 4951 currency: item.CURRENCY, 4952 value: parseFloat(item.PRICE), 4953 ecommerce: ecommerce, 4954 }); 4955 if (typeof callback == "function") { 4956 callback(); 4957 } 4958 }); 4959 } 4960 }, 4961 }); 4962 } 4963 } 4964} 4965 4966if (!funcDefined("setHeightCompany")) { 4967 function setHeightCompany() { 4968 $(".md-50.img").height($(".md-50.big").outerHeight() - 35); 4969 } 4970} 4971 4972if (!funcDefined("initSly")) { 4973 function initSly() {} 4974} 4975 4976if (!funcDefined("createTableCompare")) { 4977 function createTableCompare(originalTable, appendDiv, cloneTable) { 4978 try { 4979 var clone = originalTable.clone().removeAttr("id").addClass("clone"); 4980 if (cloneTable.length) { 4981 cloneTable.remove(); 4982 appendDiv.html(""); 4983 appendDiv.html(clone); 4984 } else { 4985 appendDiv.append(clone); 4986 } 4987 } catch (e) { 4988 } finally { 4989 } 4990 } 4991} 4992 4993if (!funcDefined("fillBasketPropsExt")) { 4994 fillBasketPropsExt = function (that, prop_code, basket_prop_div) { 4995 var i = 0, 4996 propCollection = null, 4997 foundValues = false, 4998 basketParams = {}, 4999 obBasketProps = null; 5000 5001 obBasketProps = BX(basket_prop_div); 5002 if (!obBasketProps && that.closest(".item").find(".basket_props_block").length && that.data("offers") !== "Y") 5003 obBasketProps = that.closest(".item").find(".basket_props_block")[0]; 5004 5005 if (!!obBasketProps) { 5006 propCollection = obBasketProps.getElementsByTagName("select"); 5007 if (!!propCollection && !!propCollection.length) { 5008 for (i = 0; i < propCollection.length; i++) { 5009 if (!propCollection[i].disabled) { 5010 switch (propCollection[i].type.toLowerCase()) { 5011 case "select-one": 5012 basketParams[propCollection[i].name] = propCollection[i].value; 5013 foundValues = true; 5014 break; 5015 default: 5016 break; 5017 } 5018 } 5019 } 5020 } 5021 propCollection = obBasketProps.getElementsByTagName("input"); 5022 if (!!propCollection && !!propCollection.length) { 5023 for (i = 0; i < propCollection.length; i++) { 5024 if (!propCollecti
5024on[i].disabled) { 5025 switch (propCollection[i].type.toLowerCase()) { 5026 case "hidden": 5027 basketParams[propCollection[i].name] = propCollection[i].value; 5028 foundValues = true; 5029 break; 5030 case "radio": 5031 if (propCollection[i].checked) { 5032 basketParams[propCollection[i].name] = propCollection[i].value; 5033 foundValues = true; 5034 } 5035 break; 5036 default: 5037 break; 5038 } 5039 } 5040 } 5041 } 5042 } 5043 if (!foundValues) { 5044 basketParams[prop_code] = []; 5045 basketParams[prop_code][0] = 0; 5046 } 5047 return basketParams; 5048 }; 5049} 5050if (!funcDefined("showBasketError")) { 5051 showBasketError = function (mess, title, addButton, th, callback) { 5052 var title_set = title ? title : BX.message("ERROR_BASKET_TITLE"), 5053 isButton = "N", 5054 thButton = ""; 5055 if (typeof addButton !== undefined) { 5056 isButton = "Y"; 5057 } 5058 if (typeof th !== undefined) { 5059 thButton = th; 5060 } 5061 $("body").append("<span class='add-error-bakset' style='display:none;'></span>"); 5062 jqmEd("basket_error", "error-bakset", ".add-error-bakset", mess, this, title_set, isButton, thButton); 5063 5064 if (typeof callback === "function") { 5065 callback(); 5066 } 5067 }; 5068} 5069 5070CheckTopVisibleMenu = function (that) { 5071 var dropdownMenu = $(".dropdown-menu:visible"); 5072 if (that !== undefined) { 5073 dropdownMenu.push(that); 5074 } 5075 5076 if (dropdownMenu.length) { 5077 dropdownMenu.each(function (i, el) { 5078 var dropdownMenuCurrent = $(el); 5079 dropdownMenuCurrent.find("a").css("white-space", ""); 5080 dropdownMenuCurrent.css("left", ""); 5081 dropdownMenuCurrent.css("right", ""); 5082 dropdownMenuCurrent.removeClass("toright"); 5083 5084 var dropdownMenuCurrent_left = dropdownMenuCurrent.offset().left; 5085 5086 if (typeof dropdownMenuCurrent_left != "undefined") { 5087 var menu = dropdownMenuCurrent.parents(".mega-menu"); 5088 if (!menu.length) menu = dropdownMenuCurrent.closest(".logo-row"); 5089 var menu_width = menu.outerWidth(); 5090 var menu_left = menu.offset().left; 5091 var menu_right = menu_left + menu_width; 5092 var isToRight = dropdownMenuCurrent.parents(".toright").length > 0; 5093 var parentsdropdownMenuCurrents = dropdownMenuCurrent.parents(".dropdown-menu"); 5094 var isHasParentdropdownMenuCurrent = parentsdropdownMenuCurrents.length > 0; 5095 if (isHasParentdropdownMenuCurrent) { 5096 var parentdropdownMenuCurrent_width = parentsdropdownMenuCurrents.first().outerWidth(); 5097 var parentdropdownMenuCurrent_left = parentsdropdownMenuCurrents.first().offset().left; 5098 var parentdropdownMenuCurrent_right = parentdropdownMenuCurrent_width + parentdropdownMenuCurrent_left; 5099 } 5100 5101 if (parentdropdownMenuCurrent_right + dropdownMenuCurrent.outerWidth() > menu_right) { 5102 dropdownMenuCurrent.find("a").css("white-space", "normal"); 5103 } 5104 5105 var dropdownMenuCurrent_width = dropdownMenuCurrent.outerWidth(); 5106 var dropdownMenuCurrent_right = dropdownMenuCurrent_left + dropdownMenuCurrent_width; 5107 5108 if (dropdownMenuCurrent_right > menu_right || isToRight) { 5109 var addleft = 0; 5110 addleft = menu_right - dropdownMenuCurrent_right; 5111 if (isHasParentdropdownMenuCurrent || isToRight) { 5112 dropdownMenuCurrent.css("left", "auto"); 5113 dropdownMenuCurrent.css("right", "100%"); 5114 dropdownMenuCurrent.addClass("toright"); 5115 } else { 5116 var dropdownMenuCurrent_curLeft = parseInt(dropdownMenuCurrent.css("left")); 5117 dropdownMenuCurrent.css("left", dropdownMenuCurrent_curLeft + addleft + "px"); 5118 } 5119 } 5120 } 5121 }); 5122 } 5123}; 5124 5125if (!funcDefined("isRealValue")) { 5126 function isRealValue(obj) { 5127 return obj && obj !== "null" && obj !== "undefined"; 5128 } 5129} 5130 5131if (!funcDefined("rightScroll")) { 5132 function rightScroll(prop, id) { 5133 var el = BX("prop_" + prop + "_" + id); 5134 if (el) { 5135 var curVal = parseInt(el.style.marginLeft); 5136 if (curVal >= 0) el.style.marginLeft = curVal - 20 + "%"; 5137 } 5138 } 5139} 5140 5141if (!funcDefined("leftScroll")) { 5142 function leftScroll(prop, id) { 5143 var el = BX("prop_" + prop + "_" + id); 5144 if (el) { 5145 var curVal = parseInt(el.style.marginLeft); 5146 if (curVal < 0) el.style.marginLeft = curVal + 20 + "%"; 5147 } 5148 } 5149} 5150 5151if (!funcDefined("InitOrderCustom")) { 5152 InitOrderCustom = function () { 5153 $(".ps_logo img").wrap('<div class="image"></div>'); 5154 5155 $("#bx-soa-order .radio-inline").each(function () { 5156 if ($(this).find("input").attr("checked") == "checked") { 5157 $(this).addClass("checked"); 5158 } 5159 }); 5160 5161 $("#bx-soa-order .checkbox input[type=checkbox]").each(function () { 5162 if ($(this).attr("checked") == "checked") $(this).parent().addClass("checked"); 5163 }); 5164 5165 $("#bx-soa-order .bx-authform-starrequired").each(function () { 5166 var html = $(this).html(); 5167 $(this) 5168 .closest("label") 5169 .append('<span class="bx-authform-starrequired"> ' + html + "</span>"); 5170 $(this).detach(); 5171 }); 5172 $(".bx_ordercart_coupon").each(function () { 5173 if ($(this).find(".bad").length) $(this).addClass("bad"); 5174 else if ($(this).find(".good").length) $(this).addClass("good"); 5175 }); 5176 }; 5177} 5178 5179if (!funcDefined("InitLabelAnimation")) { 5180 InitLabelAnimation = function (className) { 5181 // Fix order labels 5182 if (!$(className).length) { 5183 return; 5184 } 5185 $(className) 5186 .find(".form-group") 5187 .each(function () { 5188 if ( 5189 $(this).find("input[type=text], textarea").length && 5190 !$(this).find(".dropdown-block").length && 5191 $(this).find("input[type=text], textarea").val() != "" 5192 ) { 5193 $(this).addClass("value_y"); 5194 } 5195 }); 5196 5197 $(document).on("click", className + " .form-group:not(.bx-soa-pp-field) label", function () { 5198 $(this).parent().find("input, textarea").focus(); 5199 }); 5200 5201 $(document).on( 5202 "focusout", 5203 className + 5204 " .form-group:not(.bx-soa-pp-field) input, " + 5205 className + 5206 " .form-group:not(.bx-soa-pp-field) textarea", 5207 function () { 5208 var value = $(this).val(); 5209 if ( 5210 value != "" && 5211 !$(this).closest(".form-group").find(".dropdown-block").length && 5212 !$(this).closest(".form-group").find("#profile_change").length 5213 ) { 5214 $(this).closest(".form-group").addClass("value_y"); 5215 } else { 5216 $(this).closest(".form-group").removeClass("value_y"); 5217 } 5218 } 5219 ); 5220 5221 $(document).on( 5222 "focus", 5223 className + 5224 " .form-group:not(.bx-soa-pp-field) input, " + 5225 className + 5226 " .form-group:not(.bx-soa-pp-field) textarea", 5227 function () { 5228 if ( 5229 !$(this).closest(".form-group").find(".dropdown-block").length && 5230 !$(this).closest(".form-group").find("#profile_change").length && 5231 !$(this).closest(".form-group").find("[name=PERSON_TYPE_OLD]").length 5232 ) { 5233 $(this).closest(".form-group").addClass("value_y"); 5234 } 5235 } 5236 ); 5237 }; 5238} 5239 5240function loadScrollTabs(selector, callback = () => {}) { 5241 $(selector).iAppear(() => { 5242 BX.loadScript([arAsproOptions["SITE_TEMPLATE_PATH"] + "/js/scrollTabs.js?v=1"], function () { 5243 callback(); 5244 }); 5245 }); 5246} 5247 5248checkCaptchaWidth = function () { 5249 $(".captcha-row").each(function () { 5250 var width = $(this).actual("width"); 5251 if ($(this).hasClass("b")) { 5252 if (width > 320) { 5253 $(this).removeClass("b"); 5254 } 5255 } else { 5256 if (width <= 320) { 5257 $(this).addClass("b"); 5258 } 5259 } 5260 }); 5261}; 5262 5263checkFormWidth = function () { 5264 $(".form .form_left").each(function () { 5265 var form = $(this).parents(".form"); 5266 var width = form.actual("width"); 5267 if (form.hasClass("b")) { 5268 if (width > 417) { 5269 form.removeClass("b"); 5270 } 5271 } else { 5272 if (width <= 417) { 5273 form.addClass("b"); 5274 } 5275 } 5276 }); 5277}; 5278 5279checkFormControlWidth = function () { 5280 $(".form-control").each(function () { 5281 var width = $(this).actual("width"); 5282 var labelWidth = $(this).find("label:not(.error) > span").actual("width"); 5283 var errorWidth = $(this).find("label.error").actual("width"); 5284 if (errorWidth > 0) { 5285 if ($(this).hasClass("h")) { 5286 if (width > labelWidth + errorWidth + 5) { 5287 $(this).removeClass("h"); 5288 } 5289 } else { 5290 if (width <= labelWidth + errorWidth + 5) { 5291 $(this).addClass("h"); 5292 } 5293 } 5294 } else { 5295 $(this).removeClass("h"); 5296 } 5297 }); 5298}; 5299 5300scrollToTop = function () { 5301 if (arAsproOptions["THEME"]["SCROLLTOTOP_TYPE"] !== "NONE") { 5302 var _isScrolling = false;
5303 // Append Button 5304 $("body").append( 5305 $("<a />") 5306 .addClass( 5307 "scroll-to-top " + 5308 arAsproOptions["THEME"]["SCROLLTOTOP_TYPE"] + 5309 " " + 5310 arAsproOptions["THEME"]["SCROLLTOTOP_POSITION"] 5311 ) 5312 .attr({ href: "#", id: "scrollToTop" }) 5313 ); 5314 5315 if (arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"]) { 5316 $("#scrollToTop").css("bottom", +arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"] + "px"); 5317 } 5318 5319 if (arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_RIGHT"]) { 5320 $("#scrollToTop").css("right", +arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_RIGHT"] + "px"); 5321 } 5322 5323 $("#scrollToTop").click(function (e) { 5324 e.preventDefault(); 5325 $("body, html").animate({ scrollTop: 0 }, 500); 5326 return false; 5327 }); 5328 // Show/Hide Button on Window Scroll event. 5329 $(window).scroll(function () { 5330 if (!_isScrolling) { 5331 _isScrolling = true; 5332 if (documentScrollTopLast > 150) { 5333 $("#scrollToTop").stop(true, true).addClass("visible"); 5334 _isScrolling = false; 5335 } else { 5336 $("#scrollToTop").stop(true, true).removeClass("visible"); 5337 _isScrolling = false; 5338 } 5339 checkScrollToTop(); 5340 } 5341 }); 5342 } 5343}; 5344 5345checkScrollToTop = function () { 5346 if (arAsproOptions["THEME"] && arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"]) 5347 var bottom = +arAsproOptions["THEME"]["SCROLLTOTOP_POSITION_BOTTOM"]; 5348 else var bottom = 55; 5349 5350 var scrollVal = documentScrollTopLast, 5351 windowHeight = document.documentElement.offsetHeight, 5352 footerOffset = 0; 5353 if ($("footer").length) footerOffset = $("footer .footer-inner").offset().top; 5354 5355 if (arAsproOptions["THEME"] && arAsproOptions["THEME"]["SCROLLTOTOP_POSITION"] == "CONTENT") { 5356 warpperWidth = $("body > .wrapper > .wrapper_inner").width(); 5357 $("#scrollToTop").css("margin-left", Math.ceil(warpperWidth / 2) + 23); 5358 } 5359 5360 if (scrollVal + windowHeight > footerOffset) { 5361 $("#scrollToTop").css("bottom", Math.round(bottom + scrollVal + windowHeight - footerOffset) + "px"); 5362 } else if (parseInt($("#scrollToTop").css("bottom")) > bottom) { 5363 $("#scrollToTop").css("bottom", Math.round(bottom)); 5364 } 5365}; 5366 5367CheckObjectsSizes = function () { 5368 $(".container iframe,.container object,.container video").each(function () { 5369 var height_attr = $(this).attr("height"); 5370 var width_attr = $(this).attr("width"); 5371 if (height_attr && width_attr) { 5372 $(this).css("height", ($(this).outerWidth() * height_attr) / width_attr); 5373 } 5374 }); 5375}; 5376 5377if (!funcDefined("reloadTopBasket")) { 5378 var reloadTopBasket = function reloadTopBasket(action, basketWindow, speed, delay, slideDown, item, sync) { 5379 var obj = { 5380 PARAMS: $("#top_basket_params").val(), 5381 ACTION: action, 5382 }; 5383 if (typeof item !== "undefined" && item) { 5384 obj.delete_top_item = "Y"; 5385 obj.delete_top_item_id = item.data("id"); 5386 } 5387 // $.post( arAsproOptions['SITE_DIR']+"ajax/show_basket_popup.php", obj, $.proxy(function( data ){ 5388 $.post( 5389 arAsproOptions["SITE_DIR"] + "ajax/show_basket_actual.php", 5390 obj, 5391 $.proxy(function (data) { 5392 $(basketWindow).html(data); 5393 5394 var eventdata = { action: "loadBasket" }; 5395 BX.onCustomEvent("onCompleteAction", [eventdata]); 5396 }) 5397 ); 5398 }; 5399} 5400 5401CheckTabActive = function () { 5402 if (typeof clicked_tab && clicked_tab) { 5403 if (window.matchMedia("(min-width: 768px)").matches) { 5404 clicked_tab--; 5405 $(".nav.nav-tabs li").each(function () { 5406 if ($(this).index() == clicked_tab) $(this).addClass("active"); 5407 }); 5408 // $('.nav.nav-tabs li:eq('+clicked_tab+')').addClass('active'); 5409 $(".catalog_detail .tab-content .tab-pane:eq(" + clicked_tab + ")").addClass("active"); 5410 $(".catalog_detail .tab-content .tab-pane .title-tab-heading").next().removeAttr("style"); 5411 clicked_tab = 0; 5412 } 5413 } 5414}; 5415 5416/* countdown start */ 5417if (!funcDefined("initCountdown")) { 5418 var initCountdown = function initCountdown() { 5419 if (typeof $.fn.countdown !== "function") return; 5420 if ($(".view_sale_block").length) {
5421 $(".view_sale_block").each(function () { 5422 var _this = $(this); 5423 if (_this.hasClass("init-if-visible") && !_this.is(":visible")) return; 5424 5425 var activeTo = _this.find(".active_to").text(), 5426 dateTo = new Date(activeTo.replace(/(\d+)\.(\d+)\.(\d+)/, "$3/$2/$1")); 5427 if (_this.hasClass("compact")) 5428 _this.find(".countdown").countdown( 5429 { 5430 until: dateTo, 5431 format: "dHMS", 5432 compact: true, 5433 padZeroes: true, 5434 layout: 5435 '{d<}<span class="days item">{dn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hn}<div class="text">{hl}</div></span> <span class="minutes item">{mn}<div class="text">{ml}</div></span> <span class="sec item">{sn}<div class="text">{sl}</div></span>', 5436 }, 5437 $.countdown.regionalOptions["ru"] 5438 ); 5439 else 5440 _this.find(".countdown").countdown( 5441 { 5442 until: dateTo, 5443 format: "dHMS", 5444 padZeroes: true, 5445 layout: 5446 '{d<}<span class="days item">{dnn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hnn}<div class="text">{hl}</div></span> <span class="minutes item">{mnn}<div class="text">{ml}</div></span> <span class="sec item">{snn}<div class="text">{sl}</div></span>', 5447 }, 5448 $.countdown.regionalOptions["ru"] 5449 ); 5450 }); 5451 } 5452 }; 5453} 5454 5455if (!funcDefined("initCountdownTime")) { 5456 var initCountdownTime = function initCountdownTime(block, time) { 5457 if (typeof $.fn.countdown !== "function") return; 5458 if (time) { 5459 var dateTo = new Date(time.replace(/(\d+)\.(\d+)\.(\d+)/, "$3/$2/$1")); 5460 block.find(".countdown").countdown("destroy"); 5461 if (block.hasClass("compact")) 5462 block.find(".countdown").countdown( 5463 { 5464 until: dateTo, 5465 format: "dHM", 5466 compact: true, 5467 padZeroes: true, 5468 layout: 5469 '{d<}<span class="days item">{dn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hn}<div class="text">{hl}</div></span> <span class="minutes item">{mn}<div class="text">{ml}</div></span> <span class="sec item">{sn}<div class="text">{sl}</div></span>', 5470 }, 5471 $.countdown.regionalOptions["ru"] 5472 ); 5473 else 5474 block.find(".countdown").countdown( 5475 { 5476 until: dateTo, 5477 format: "dHMS", 5478 padZeroes: true, 5479 layout: 5480 '{d<}<span class="days item">{dnn}<div class="text">{dl}</div></span>{d>} <span class="hours item">{hnn}<div class="text">{hl}</div></span> <span class="minutes item">{mnn}<div class="text">{ml}</div></span> <span class="sec item">{snn}<div class="text">{sl}</div></span>', 5481 }, 5482 $.countdown.regionalOptions["ru"] 5483 ); 5484 block.find(".view_sale_block").show(); 5485 } else { 5486 block.find(".view_sale_block").hide(); 5487 } 5488 }; 5489} 5490/* countdown end */ 5491 5492waitCounter = function (idCounter, delay, callback) { 5493 var obCounter = window["yaCounter" + idCounter]; 5494 if (typeof obCounter == "object") { 5495 if (typeof callback == "function") callback(); 5496 } else { 5497 setTimeout(function () { 5498 waitCounter(idCounter, delay, callback); 5499 }, delay); 5500 } 5501}; 5502 5503var isOnceInited = (insertFilter = false); 5504var animationTime = 200; 5505var delayTime = 200; 5506var topMenuEnterTimer = false; 5507var previewMode = window != window.top; 5508var isMobile = window.matchMedia("(max-width:991px)").matches; 5509if (isMobile) document.documentElement.className += " mobile"; 5510if (previewMode) document.documentElement.className += " previewMode"; 5511 5512if (navigator.userAgent.indexOf("Edge") != -1) document.documentElement.className += " bx-ie-edge"; 5513 5514/* filter start */ 5515if (!funcDefined("checkVerticalMobileFilter")) { 5516 var checkVerticalMobileFilter = function checkVerticalMobileFilter() {}; 5517} 5518/* filter end */ 5519 5520// ONE CLICK 5521if (!funcDefined("oneClickBuy")) { 5522 var oneClickBuy = function (elementID, iblockID, that) { 5523 var name = "one_click_buy"; 5524 var elementQuantity = 1; 5525 var offerProps = false;
5526 var buy_btn = $(that).closest(".buy_block").find(".to-cart"); 5527 var buy_btn2 = $(that).closest("tr").find(".to-cart"); 5528 var buy_btn3 = $(that).closest(".item").find(".to-cart"); 5529 5530 if (typeof that !== "undefined") { 5531 elementQuantity = $(that).attr("data-quantity"); 5532 offerProps = $(that).attr("data-props"); 5533 } 5534 5535 if (elementQuantity < 0) { 5536 elementQuantity = 1; 5537 } 5538 5539 var tmp_props = buy_btn.data("props") || buy_btn2.data("props") || buy_btn3.data("props"), 5540 props = "", 5541 part_props = "", 5542 add_props = "N", 5543 fill_prop = {}, 5544 iblockid = buy_btn.data("iblockid"), 5545 item = buy_btn.attr("data-item"); 5546 5547 if (tmp_props) { 5548 props = tmp_props.split(";"); 5549 } 5550 if (buy_btn.data("part_props")) { 5551 part_props = buy_btn.data("part_props"); 5552 } 5553 if (buy_btn.data("add_props")) { 5554 add_props = buy_btn.data("add_props"); 5555 } 5556 5557 fill_prop = fillBasketPropsExt(buy_btn, "prop", buy_btn.data("bakset_div")); 5558 fill_prop.iblockID = iblockid; 5559 fill_prop.part_props = part_props; 5560 fill_prop.add_props = add_props; 5561 fill_prop.props = JSON.stringify(props); 5562 fill_prop.item = item; 5563 fill_prop.ocb_item = "Y"; 5564 5565 // if (!isMobile) { 5566 if (!$(that).hasClass("clicked")) { 5567 $(that).addClass("clicked"); 5568 $("body") 5569 .find("." + name + "_frame") 5570 .remove(); 5571 $("body") 5572 .find("." + name + "_trigger") 5573 .remove(); 5574 $("body #popup_iframe_wrapper").append('<div class="' + name + '_frame popup"></div>'); 5575 $("body #popup_iframe_wrapper").append('<div class="' + name + '_trigger"></div>'); 5576 5577 loadJQM(() => { 5578 $("." + name + "_frame").jqm({ 5579 trigger: "." + name + "_trigger", 5580 onHide: function (hash) { 5581 onHidejqm(name, hash); 5582 }, 5583 toTop: false, 5584 onLoad: function (hash) { 5585 onLoadjqm(name, hash, "", false, false, false, that); 5586 }, 5587 ajax: 5588 arAsproOptions["SITE_DIR"] + 5589 "ajax/one_click_buy.php?ELEMENT_ID=" + 5590 elementID + 5591 "&IBLOCK_ID=" + 5592 iblockID + 5593 "&ELEMENT_QUANTITY=" + 5594 elementQuantity + 5595 "&OFFER_PROPS=" + 5596 fill_prop.props, 5597 }); 5598 5599 $("." + name + "_trigger").click(); 5600 }); 5601 } 5602 }; 5603} 5604 5605if (!funcDefined("oneClickBuyBasket")) { 5606 var oneClickBuyBasket = function () { 5607 const name = "one_click_buy_basket"; 5608 if (!$(".fast_order").hasClass("clicked")) { 5609 $(".fast_order").addClass("clicked"); 5610 $("body ." + name + "_frame").remove(); 5611 $("body ." + name + "_trigger").remove(); 5612 $("body #popup_iframe_wrapper").append( 5613 '<div class="' + name + '_frame popup"></div>', 5614 '<div class="' + name + '_trigger"></div>' 5615 ); 5616 5617 loadJQM(() => { 5618 $("." + name + "_frame").jqm({ 5619 trigger: "." + name + "_trigger", 5620 onHide: function (hash) { 5621 onHidejqm(name, hash); 5622 }, 5623 onLoad: function (hash) { 5624 onLoadjqm(name, hash); 5625 }, 5626 ajax: arAsproOptions["SITE_DIR"] + "ajax/one_click_buy_basket.php", 5627 }); 5628 5629 $("." + name + "_trigger").click(); 5630 }); 5631 } 5632 }; 5633} 5634 5635// TOP MENU ANIMATION 5636$(document).on("click", ".menu_top_block>li .more a", function () { 5637 $this = $(this); 5638 $this.parents(".dropdown").first().find(">.hidden").removeClass("hidden"); 5639 $this.parent().addClass("hidden"); 5640 setTimeout(function () { 5641 $this.parent().remove(); 5642 }, 500); 5643}); 5644 5645$(document).on("mouseenter", ".menu_top_block.catalogfirst>li>.dropdown>li.full", function () { 5646 var $submenu = $(this).find(">.dropdown"); 5647 5648 if ($submenu.length) { 5649 if (topMenuEnterTimer) { 5650 clearTimeout(topMenuEnterTimer); 5651 topMenuEnterTimer = false; 5652 } 5653 } 5654}); 5655 5656$(document).on("mouseenter", ".menu_top_block>li:not(.full)", function () { 5657 var $submenu = $(this).find(">.dropdown"); 5658 5659 if ($submenu.length && !$submenu.hasClass("visible")) { 5660 var $menu = $(this).parents(".menu"); 5661 var $wrapmenu = $menu.parents(".wrap_menu"); 5662 var wrapMenuWidth = $wrapmenu.actual("outerWidth"); 5663 var wrapMenuLeft = $wrapmenu.offset().left; 5664 var wrapMenuRight = wrapMenuLeft + wrapMenuWidth; 5665 var left = wrapMenuRight - ($(this).offset().left + $submenu.actual("outerWidth")); 5666 if ( 5667 window.matchMedia("(min-width: 951px)").matches && 5668 $(this).hasClass("catalog") && 5669 ($(".banner_auto").hasClass("catalog_page") || $(".banner_auto").hasClass("front_page")) 5670 ) { 5671 return; 5672 } 5673 if (left < 0) { 5674 $submenu.css({ left: left + "px" }); 5675 } 5676 $submenu.stop().slideDown(animationTime, function () { 5677 $submenu.css({ height: "", overflow: "visible" }); 5678 }); 5679 5680 $(this).on("mouseleave", function () { 5681 var leaveTimer = setTimeout(function () { 5682 $submenu.stop().slideUp(animationTime, function () { 5683 $submenu.css({ left: "" }); 5684 }); 5685 }, delayTime); 5686 5687 $(this).on("mouseenter", function () { 5688 if (leaveTimer) { 5689 clearTimeout(leaveTimer); 5690 leaveTimer = false;
5691 } 5692 }); 5693 }); 5694 } 5695}); 5696 5697$(document).on("mouseenter", ".menu_top_block>li .dropdown>li", function () { 5698 var $this = $(this); 5699 var $submenu = $this.find(">.dropdown"); 5700 5701 if ( 5702 $submenu.length && 5703 ((!$this.parents(".full").length && !$this.hasClass("full")) || $this.parents(".more").length) 5704 ) { 5705 var $menu = $this.parents(".menu"); 5706 var $wrapmenu = $menu.parents(".wrap_menu"); 5707 var arParentSubmenuForOpacity = []; 5708 topMenuEnterTimer = setTimeout(function () { 5709 var wrapMenuWidth = $wrapmenu.actual("outerWidth"); 5710 var wrapMenuLeft = $wrapmenu.offset().left; 5711 var wrapMenuRight = wrapMenuLeft + wrapMenuWidth; 5712 var $parentSubmenu = $this.parent(); 5713 var bToLeft = $parentSubmenu.hasClass("toleft") ? true : false; 5714 if (!bToLeft) { 5715 bToLeft = $this.offset().left + $this.actual("outerWidth") + $submenu.actual("outerWidth") > wrapMenuRight; 5716 } else { 5717 bToLeft = $this.offset().left + $this.actual("outerWidth") - $submenu.actual("outerWidth") < wrapMenuLeft; 5718 } 5719 5720 if (bToLeft) { 5721 $this.find(">.dropdown").addClass("toleft").show(); 5722 } else { 5723 $this.find(">.dropdown").removeClass("toleft").show(); 5724 } 5725 var submenuLeft = $submenu.offset().left; 5726 var submenuRight = submenuLeft + $submenu.actual("outerWidth"); 5727 5728 $this.parents(".dropdown").each(function () { 5729 var $this = $(this); 5730 var leftOffset = $this.offset().left; 5731 var rightOffset = leftOffset + $this.actual("outerWidth"); 5732 if ( 5733 (leftOffset >= submenuLeft && leftOffset < submenuRight - 1) || 5734 (rightOffset > submenuLeft + 1 && rightOffset <= submenuRight) 5735 ) { 5736 arParentSubmenuForOpacity.push($this); 5737 $this.find(">li>a").css({ opacity: "0.1" }); 5738 } 5739 }); 5740 }, delayTime); 5741 5742 $this.unbind("mouseleave"); 5743 $this.on("mouseleave", function () { 5744 var leaveTimer = setTimeout(function () { 5745 $this.find(".dropdown").removeClass("toleft").hide(); 5746 if (arParentSubmenuForOpacity.length) { 5747 for (i in arParentSubmenuForOpacity) { 5748 arParentSubmenuForOpacity[i].find(">li>a").css({ opacity: "" }); 5749 } 5750 } 5751 }, delayTime); 5752 5753 $this.unbind("mouseenter"); 5754 $this.on("mouseenter", function () { 5755 if (leaveTimer) { 5756 clearTimeout(leaveTimer); 5757 leaveTimer = false; 5758 } 5759 }); 5760 }); 5761 } 5762});
5763CheckFlexSlider = function () {}; 5764 5765InitScrollBar = function (el, initOptions) {}; 5766InitCustomScrollBar = function (el) {}; 5767 5768/* slider gallery for fancybox */ 5769const InitFancyboxThumbnailsGallery = function (instance) { 5770 if ( 5771 $(".fancybox-thumbs") && 5772 $(".fancybox-thumbs__list a").length > 1 && 5773 !$(".fancybox-thumbs .swiper").length && 5774 typeof initSwiperSlider === "function" 5775 ) { 5776 5777 // update preview when lazyloaded 5778 instance.Thumbs.$grid.find(".fancybox-thumbs__list a").each(function (i, el) { 5779 $(el).css("background-image", "url('" + encodeURI(instance.group[i].src) + "')"); 5780 }); 5781 5782 const SLIDER_RESIZE_BREAKPOINT = 600; 5783 const $swiperSlides = $(".fancybox-thumbs__list a"); 5784 const $swiperWrapper = $(".fancybox-thumbs__list"); 5785 const sliderDirection = window.innerWidth >= SLIDER_RESIZE_BREAKPOINT ? "vertical" : "horizontal"; 5786 5787 const options = { 5788 centerInsufficientSlides: true, 5789 direction: sliderDirection, 5790 mousewheelControl: true, 5791 setWrapperSize: true, 5792 slidesPerView: 3, 5793 spaceBetween: 16, 5794 breakpoints: { 5795 400: { 5796 slidesPerView: 5, 5797 }, 5798 }, 5799 }; 5800 5801 if ($swiperSlides.length > 5) { 5802 options.navigation = { 5803 nextEl: ".fancybox-thumbs__wrapper .swiper-button-next", 5804 prevEl: ".fancybox-thumbs__wrapper .swiper-button-prev", 5805 }; 5806 } 5807 5808 $(".fancybox-thumbs").wrapInner( 5809 "<div class='fancybox-thumbs__wrapper'><div class='swiper' data-plugin-options='" + 5810 JSON.stringify(options) + 5811 "' /></div>" 5812 ); 5813 const $swiperContainerWrapper = $(".fancybox-thumbs__wrapper"); 5814 5815 if ($swiperSlides.length > 5) { 5816 $swiperContainerWrapper.append( 5817 "<div class='swiper-button-next'><i class='svg right'><svg xmlns='http://www.w3.org/2000/svg' width='12' height='6.969' viewBox='0 0 12 6.969'><path id='Rounded_Rectangle_702_copy_24' data-name='Rounded Rectangle 702 copy 24' class='cls-1' d='M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z' transform='translate(-350 -395.031)'></path></svg></i></div>" 5818 ); 5819 $swiperContainerWrapper.prepend( 5820 "<div class='swiper-button-prev'><i class='svg left'><svg xmlns='http://www.w3.org/2000/svg' width='12' height='6.969' viewBox='0 0 12 6.969'><path id='Rounded_Rectangle_702_copy_24' data-name='Rounded Rectangle 702 copy 24' class='cls-1' d='M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z' transform='translate(-350 -395.031)'></path></svg></i></div>" 5821 ); 5822 } 5823 $swiperWrapper.addClass("swiper-wrapper"); 5824 $swiperSlides.addClass("swiper-slide"); 5825 5826 initSwiperSlider(".fancybox-thumbs .swiper"); 5827 5828 const swiper = $(".fancybox-thumbs .swiper").data("swiper"); 5829 5830 swiper.slideTo(instance.curPos, 10); 5831 swiper.on("resize", function () { 5832 if (window.innerWidth >= SLIDER_RESIZE_BREAKPOINT && options.direction === "horizontal") { 5833 options.direction = "vertical"; 5834 swiper.changeDirection(options.direction, false); 5835 $swiperWrapper.css("width", "auto"); 5836 swiper.update(); 5837 } else if (window.innerWidth < SLIDER_RESIZE_BREAKPOINT && options.direction === "vertical") { 5838 options.direction = "horizontal"; 5839 swiper.changeDirection(options.direction, false); 5840 $swiperWrapper.css("height", "auto"); 5841 swiper.update(); 5842 } 5843 }); 5844 } 5845}; 5846 5847fancyBoxOpts = { 5848 padding: [40, 40, 64, 40], 5849 openEffect: "fade", 5850 closeEffect: "fade", 5851 nextEffect: "fade", 5852 prevEffect: "fade", 5853 opacity: true, 5854 tpl: { 5855 closeBtn: 5856 '<span title="' + 5857 BX.message("FANCY_CLOSE") + 5858 '" class="fancybox-item fancybox-close inline svg"><svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg></span>', 5859 next: 5860 '<a title="' + 5861 BX.message("FANCY_NEXT") + 5862 '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', 5863 prev: 5864 '<a title="' + 5865 BX.message("FANCY_PREV") + 5866 '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>', 5867 }, 5868 btnTpl: { 5869 close: 5870 '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' + 5871 '<i class="svg"><svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></svg></i>' + 5872 "</button>", 5873 5874 arrowLeft: 5875 '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' + 5876 '<div><i class="svg left"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 13L0.585787 14.4142C-0.195262 13.6332 -0.195262 12.3668 0.585787 11.5858L2 13ZM11.5858 0.585786C12.3668 -0.195262 13.6332 -0.195262 14.4142 0.585786C15.1953 1.36683 15.1953 2.63317 14.4142 3.41421L11.5858 0.585786ZM14.4142 22.5858C15.1953 23.3668 15.1953 24.6332 14.4142 25.4142C13.6332 26.1953 12.3668 26.1953 11.5858 25.4142L14.4142 22.5858ZM0.585787 11.5858L11.5858 0.585786L14.4142 3.41421L3.41421 14.4142L0.585787 11.5858ZM3.41421 11.5858L14.4142 22.5858L11.5858 25.4142L0.585787 14.4142L3.41421 11.5858Z" fill="#999999"/></svg></i></div>' + 5877 "</button>", 5878 5879 arrowRight: 5880 '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' + 5881 '<div><i class="svg right"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 13L14.4142 14.4142C15.1953 13.6332 15.1953 12.3668 14.4142 11.5858L13 13ZM3.41421 0.585786C2.63317 -0.195262 1.36683 -0.195262 0.585786 0.585786C-0.195262 1.36683 -0.195262 2.63317 0.585786 3.41421L3.41421 0.585786ZM0.585786 22.5858C-0.195262 23.3668 -0.195262 24.6332 0.585786 25.4142C1.36683 26.1953 2.63317 26.1953 3.41421 25.4142L0.585786 22.5858ZM14.4142 11.5858L3.41421 0.585786L0.585786 3.41421L11.5858 14.4142L14.4142 11.5858ZM11.5858 11.5858L0.585786 22.5858L3.41421 25.4142L14.4142 14.4142L11.5858 11.5858Z" fill="white"/></svg></i></div>' + 5882 "</button>", 5883 }, 5884 touch: "enabled", 5885 buttons: ["close"], 5886 thumbs: { 5887 autoStart: true, 5888 }, 5889 backFocus: false, 5890 onActivate: function (instance) { 5891 InitFancyboxThumbnailsGallery(instance); 5892 }, 5893 beforeShow: function (instance, current) { 5894 if ($(".fancybox-thumbs .swiper").length) { 5895 const swiper = $(".fancybox-thumbs .swiper").data("swiper"); 5896 5897 swiper.slideTo(current.index); 5898 } 5899 let bCurrentSrc = typeof current !== "undefined" && current.contentType == "html" && $(current.src).length; 5900 5901 if (bCurrentSrc) { 5902 let $companyBlock = current.src.closest(".company-block"); 5903 if ($companyBlock.length) { 5904 var $video_block = $companyBlock.find(".video")[0]; 5905 if ($video_block && !$video_block.nextElementSibling) { 5906 $videoContent = $video_block.content.cloneNode(true); 5907 $source = $videoContent.querySelector(".video-block"); 5908 $source.setAttribute("src", $source.dataset["src"]); 5909 $video_block.parentNode.insertBefore($videoContent, $video_block.nextSibling); 5910 } 5911 5912 var video_block_frame = $companyBlock.find(".video-block__iframe"); 5913 if (video_block_frame.length) { 5914 var data_src_iframe = video_block_frame.attr("data-src"); 5915 video_block_frame.attr("src", data_src_iframe); 5916 video_block_frame.attr("allow", "autoplay"); 5917 } 5918 } 5919 } 5920 }, 5921 afterShow: function (instance, current) { 5922 if ($(".fancybox-overlay").css("opacity") == 0) { 5923 setTimeout(function () { 5924 $(".fancybox-overlay").css("opacity", 1); 5925 $("html").addClass("overflow_html"); 5926 }, 200); 5927 } 5928 5929 $(".fancybox-nav").css("opacity", 0); 5930 setTimeout(function () { 5931 $(".fancybox-nav").css("opacity", 1); 5932 }, 150); 5933 5934 if ($(".fancybox-inner .video-block").length) { 5935 // var fancyHeight = $('.fancybox-wrap').height(); 5936 // $('.fancybox-inner').height(fancyHeight); 5937 setTimeout(function () { 5938 $(".fancybox-wrap video").resize(); 5939 setTimeout(function () { 5940 $(".fancybox-wrap").addClass("show_video"); 5941 document.getElementById("company_video").currentTime = 0; 5942 document.getElementById("company_video").play(); 5943 }, 300); 5944 }, 150); 5945 } else if ($(".fancybox-wrap iframe").length) { 5946 $(".fancybox-inner").height("100%"); 5947 } 5948 }, 5949 beforeClose: function () { 5950 $(".fancybox-overlay").fadeOut(); 5951 $("html").removeClass("overflow_html"); 5952 5953 if ($("#company_video").length) { 5954 document.getElementById("company_video").currentTime = 0; 5955 } 5956 5957 var video_block_frame = $(".company-block .video-block"); 5958 if (video_block_frame.length) { 5959 $(".video-block__iframe").attr("src", ""); 5960 } 5961 }, 5962 onClosed: function () { 5963 if ($(".fancybox-wrap #company_video").length) { 5964 document.getElementById("company_video").pause(); 5965 } 5966 }, 5967}; 5968 5969InitFancyBox = function () { 5970 if (typeof $.fn.fancybox !== "function") { 5971 return; 5972 } 5973 5974 if (!$(".fancy").length) { 5975 return; 5976 } 5977 5978 $(".fancy").fancybox(fancyBoxOpts); 5979}; 5980 5981InitFancyBoxVideo = function () { 5982 if (typeof $.fn.fancybox !== "function") { 5983 return; 5984 } 5985 5986 if (!$(".video_link").length) { 5987 return; 5988 } 5989 $(".video_link").fancybox({ 5990 type: "iframe", 5991 iframe: { 5992 preload: false, 5993 }, 5994 maxWidth: 800, 5995 maxHeight: 600, 5996 fitToView: false, 5997 width: "70%", 5998 height: "70%", 5999 autoSize: false, 6000 closeClick: false, 6001 opacity: true, 6002 tpl: { 6003 closeBtn: 6004 '<span title="' + 6005 BX.message("FANCY_CLOSE") + 6006 '" class="fancybox-item fancybox-close inline svg"><svg class="svg svg-close" width="14" height="14" viewBox="0 0 14 14"><path data-name="Rounded Rectangle 568 copy 16" d="M1009.4,953l5.32,5.315a0.987,0.987,0,0,1,0,1.4,1,1,0,0,1-1.41,0L1008,954.4l-5.32,5.315a0.991,0.991,0,0,1-1.4-1.4L1006.6,953l-5.32-5.315a0.991,0.991,0,0,1,1.4-1.4l5.32,5.315,5.31-5.315a1,1,0,0,1,1.41,0,0.987,0.987,0,0,1,0,1.4Z" transform="translate(-1001 -946)"></path></svg></span>', 6007 next: 6008 '<a title="' + 6009 BX.message("FANCY_NEXT") + 6010 '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', 6011 prev: 6012 '<a title="' + 6013 BX.message("FANCY_PREV") + 6014 '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>', 6015 }, 6016 afterShow: function () { 6017 if ($(".fancybox-overlay").css("opacity") == 0) { 6018 setTimeout(function () { 6019 $(".fancybox-overlay").css("opacity", 1); 6020 $("html").addClass("overflow_html"); 6021 }, 200); 6022 } 6023 6024 $(".fancybox-nav").css("opacity", 0); 6025 setTimeout(function () { 6026 $(".fancybox-nav").css("opacity", 1); 6027 }, 150); 6028 if ($(".fancybox-wrap iframe").length) { 6029 $(".fancybox-inner").height("100%"); 6030 } 6031 }, 6032 beforeClose: function () { 6033 $(".fancybox-overlay").fadeOut(); 6034 $("html").removeClass("overflow_html"); 6035 }, 6036 }); 6037}; 6038 6039InitStickySideBar = function (el, container_el) { 6040 var block = ".sticky-sidebar",
6041 container_catalog = ".wraps .wrapper_inner .container_inner .main-catalog-wrapper", 6042 container = ".wraps .wrapper_inner .container_inner"; 6043 if (typeof el !== "undefined") block = el; 6044 6045 if ($(container_catalog).length) container = container_catalog; 6046 6047 if (typeof container_el !== "undefined") container = container_el; 6048 6049 if ($(block).length && arAsproOptions["THEME"]["STICKY_SIDEBAR"] != "N") { 6050 if (typeof window["stickySidebar"] !== "undefined") { 6051 window["stickySidebar"].destroy(); 6052 } 6053 6054 window["stickySidebar"] = new StickySidebar(block, { 6055 topSpacing: 60, 6056 bottomSpacing: 20, 6057 containerSelector: container, 6058 resizeSensor: true, 6059 innerWrapperSelector: ".sticky-sidebar__inner", 6060 }); 6061 6062 if ($(".sticky-sidebar .sticky-sidebar__inner .banner img").length) { 6063 $(".sticky-sidebar .sticky-sidebar__inner .banner img")[0].onload = function () { 6064 if (typeof window["stickySidebar"] !== "undefined") { 6065 window["stickySidebar"].updateSticky(); 6066 } 6067 }; 6068 } 6069 } 6070}; 6071 6072InitOwlSlider = function () { 6073 if (typeof $.fn.owlCarousel !== "function") { 6074 return; 6075 } 6076 $(".owl-carousel:not(.owl-loaded):not(.appear-block)").each(function () { 6077 var slider = $(this); 6078 var options; 6079 var svg = 6080 '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6.969" viewBox="0 0 12 6.969"><path id="Rounded_Rectangle_702_copy_24" data-name="Rounded Rectangle 702 copy 24" class="cls-1" d="M361.691,401.707a1,1,0,0,1-1.414,0L356,397.416l-4.306,4.291a1,1,0,0,1-1.414,0,0.991,0.991,0,0,1,0-1.406l5.016-5a1.006,1.006,0,0,1,1.415,0l4.984,5A0.989,0.989,0,0,1,361.691,401.707Z" transform="translate(-350 -395.031)"/></svg>'; 6081 var defaults = { 6082 navText: [ 6083 '<i class="svg left colored_theme_hover_text">' + svg + "</i>", 6084 '<i class="svg right colored_theme_hover_text">' + svg + "</i>", 6085 ], 6086 }; 6087 var config = $.extend({}, defaults, options, slider.data("plugin-options")); 6088 6089 slider.on("initialized.owl.carousel", function (event) { 6090 var eventdata = { slider: event }; 6091 BX.onCustomEvent("onSliderInitialized", [eventdata]); 6092 BX.onCustomEvent("onSlide", [eventdata]); 6093 6094 $(event.target).removeClass("loading-state"); 6095 $(event.target).find(".owl-item:first").addClass("current"); 6096 6097 if ($(event.target).hasClass("catalog_block")) { 6098 if (typeof sliceItemBlockSlide === "function") { 6099 sliceItemBlockSlide(); 6100 } 6101 } 6102 6103 if (typeof window["stickySidebar"] !== "undefined") { 6104 window["stickySidebar"].updateSticky(); 6105 } 6106 }); 6107 // if slider was inited on animated scrolling to block, than need rescroll 6108 if ($("body.scrolling-state").length) { 6109 slider.on("initialized.owl.carousel", function (event) { 6110 setTimeout(function () { 6111 scrollToBlock.rescroll(); 6112 }, 100); 6113 }); 6114 } 6115 6116 slider.on("change.owl.carousel", function (event) { 6117 // var eventdata = {slider: $(event.target)}; 6118 // BX.onCustomEvent('onSlide', [eventdata]); 6119 }); 6120 6121 slider.owlCarousel(config); 6122 6123 slider.on("resized.owl.carousel", function (event) { 6124 if (typeof sliceItemBlockSlide === "function") { 6125 sliceItemBlockSlide({ resize: false }); 6126 } 6127 }); 6128 6129 slider.on("changed.owl.carousel", function (event) { 6130 var $slider = $(event.target); 6131 var sliderData = $slider.data("owl.carousel"); 6132 var pluginOptions = $slider.data("pluginOptions"); 6133 6134 var eventdata = { slider: $slider, data: event }; 6135 BX.onCustomEvent("onSlide", [eventdata]); 6136 6137 if (pluginOptions) { 6138 // click .ajax_load_btn 6139 if ($slider.parent().find(".ajax_load_btn").length) { 6140 if (sliderData._current + 1 + sliderData.settings.items >= sliderData._items.length) { 6141 $slider.parent().find(".ajax_load_btn").trigger("click"); 6142 } 6143 } 6144 if (typeofExt(pluginOptions) === "object") { 6145 if ("index" in pluginOptions) { 6146 if ($(".gallery-view_switch").length) { 6147 $(".gallery-view_switch__count-wrapper--big .gallery-view_switch__count-value").text( 6148 event.item.index + 1 + "/" + event.item.count 6149 ); 6150 } 6151 } 6152 6153 if ("relatedTo" in $(event.target).data("pluginOptions")) { 6154 var relatedClass = $(event.target).data("pluginOptions").relatedTo, 6155 relatedBlock = $(relatedClass); 6156 6157 if (relatedBlock.length && $(event.target).data("owl.carousel")) { 6158 if (!$(event.target).data("owl.carousel").loop) { 6159 var current = event.item.index; 6160 } else { 6161 var count = event.item.count - 1; 6162 var current = Math.round(event.item.index - event.item.count / 2 - 0.5); 6163 6164 if (current < 0) current = count; 6165 6166 if (current > count) current = 0; 6167 } 6168 6169 relatedBlock.find(".owl-item").removeClass("current").eq(current).addClass("current"); 6170 6171 var onscreen = relatedBlock.find(".owl-item.active").length - 1; 6172 var start = relatedBlock.find(".owl-item.active").first().index(); 6173 var end = relatedBlock.find(".owl-item.active").last().index(); 6174 6175 if (current > end) relatedBlock.data("owl.carousel").to(current, 100, true); 6176 6177 if (current < start) relatedBlock.data("owl.carousel").to(current - onscreen, 100, true); 6178 // $(".owl-slider-"+id).trigger('to.owl.carousel', [itemCarousel]) 6179 } 6180 } 6181 } 6182 } 6183 }); 6184 6185 slider.on("translated.owl.carousel", function (event) {}); 6186 6187 if ("clickTo" in config) { 6188 var relatedClass = config.clickTo, 6189 magnifier = "magnifier" in config; 6190 6191 slider.on("click", ".owl-item", function (e) { 6192 e.preventDefault(); 6193 var _this = $(this), 6194 number = _this.index(); 6195 6196 if (magnifier) { 6197 if ($(relatedClass).closest(".product-container").find(".zoom_picture").length) { 6198 $(relatedClass) 6199 .closest(".product-container") 6200 .find(".zoom_picture") 6201 .attr("data-large", _this.find(".product-detail-gallery__item").data("big")); 6202 $(relatedClass) 6203 .closest(".product-container") 6204 .find(".zoom_picture") 6205 .attr("xoriginal", _this.find(".product-detail-gallery__item").data("big")); 6206 $(relatedClass) 6207 .closest(".product-container") 6208 .find(".zoom_picture") 6209 .attr("src", _this.find(".product-detail-gallery__item img").attr("src")); 6210 } 6211 _this.siblings("").removeClass("current"); 6212 _this.addClass("current"); 6213 } else { 6214 $(relatedClass).data("owl.carousel").to(number, 300, true); 6215 } 6216 }); 6217 } 6218 }); 6219}; 6220 6221InitFlexSlider = function () { 6222 //todo need remove 6223}; 6224 6225inIframe = function () { 6226 try { 6227 return window.self !== window.top; 6228 } catch (e) { 6229 return true; 6230 } 6231}; 6232 6233InitZoomPict = function (el) { 6234 const zoomer = typeof el !== "undefined" ? el : $(".zoom_picture"); 6235 6236 if (zoomer.length) { 6237 var options; 6238 const defaults = { 6239 title: false, 6240 scroll: false, 6241 Xoffset: 15, 6242 tint: "#333", 6243 defaultScale: -1, 6244 }; 6245 6246 const config = $.extend({}, defaults, options, zoomer.data("plugin-options")); 6247 zoomer.xzoom(config); 6248 6249 // checks if zoomer doesn't have the event listenners
6250 const zoomerEventsListeners = $._data(zoomer.get(0), "events"); 6251 6252 if (!zoomerEventsListeners.mouseout && !zoomerEventsListeners.load) { 6253 zoomer.on("mouseleave", function () { 6254 zoomer.data("xzoom").movezoom; 6255 let mObjWidth = parseInt(zoomer.attr("data-xoriginalwidth")); 6256 let mObHeight = parseInt(zoomer.attr("data-xoriginalheight")); 6257 let imgObjWidth = Math.round(zoomer.width()); 6258 let imgObjheight = Math.round(zoomer.height()); 6259 if (mObjWidth === imgObjWidth && imgObjheight === mObHeight) { 6260 $(".xzoom-preview").addClass("hidden"); 6261 $(".xzoom-source > div").addClass("hidden"); 6262 } else { 6263 $(".xzoom-preview").removeClass("hidden"); 6264 $(".xzoom-source > div").removeClass("hidden"); 6265 } 6266 }); 6267 6268 zoomer.on("load", function () { 6269 const zoomerParentWidth = Math.round(zoomer.parent().width()); 6270 const zoomerHeight = Math.round(zoomer.height()); 6271 const zoomerWidth = Math.round(zoomer.width()); 6272 const sizeMultiplier = 1.5; 6273 6274 const zoomWidth = 6275 zoomerWidth < zoomerParentWidth / 2 && zoomerHeight > zoomerWidth ? zoomerWidth * sizeMultiplier : "auto"; 6276 6277 zoomer.data("xzoom").destroy(); 6278 zoomer.removeData("xzoom"); 6279 zoomer.width("auto"); 6280 6281 config.zoomWidth = zoomWidth; 6282 zoomer.xzoom(config); 6283 }); 6284 } 6285 } 6286}; 6287 6288InitAppear = function() { 6289 const $nodeListAppearBlock = $(".appear-block"); 6290 if ($nodeListAppearBlock.length) { 6291 $nodeListAppearBlock.iAppear( 6292 function () { 6293 const eventdata = { 6294 target: this 6295 }; 6296 BX.onCustomEvent("onAppearVideoBlockShow", [eventdata]); 6297 6298 const $nodeAppearBlock = $(this); 6299 $nodeAppearBlock.removeClass("appear-block"); 6300 $nodeAppearBlock.find(".appear-block").removeClass("appear-block"); 6301 6302 typeof InitOwlSlider === "function" && InitOwlSlider(); 6303 typeof initSwiperSlider === "function" && initSwiperSlider(); 6304 }, 6305 { 6306 rootMargin: "150px 0px 150px 0px", 6307 accX: 0, 6308 accY: 150, 6309 } 6310 ); 6311 } 6312} 6313 6314var arBasketAsproCounters = (arStatusBasketAspro = arBasketPrices = {}); 6315SetActualBasketFlyCounters = function (sync) { 6316 if (arBasketAsproCounters.DEFAULT == true) { 6317 $.ajax({ 6318 url: arAsproOptions["SITE_DIR"] + "ajax/basket_fly.php", 6319 type: "post", 6320 success: function (html) { 6321 $("#basket_line .basket_fly").removeClass("loaded").html(html); 6322 6323 if (typeof sync !== "undefined") { 6324 $.ajax({ 6325 type: "GET", 6326 url: arAsproOptions["SITE_DIR"] + "ajax/actualBasket.php", 6327 // data:data, 6328 success: function (data) { 6329 if (!$(".js_ajax").length) $("body").append('<div class="js_ajax"></div>'); 6330 $(".js_ajax").html(data); 6331 6332 setBasketStatusBtn(true); 6333 }, 6334 }); 6335 } 6336 }, 6337 }); 6338 } else { 6339 // insert currency ₽ by this hack!: $('<div/>').html(arBasketAsproCounters.READY.TITLE).text() 6340 $(".basket_fly .opener .basket_count .count") 6341 .attr("class", "count" + (arBasketAsproCounters.READY.COUNT > 0 ? "" : " empty_items")) 6342 .find(".items span") 6343 .text(arBasketAsproCounters.READY.COUNT); 6344 $(".basket_fly .opener .basket_count + a").attr("href", arBasketAsproCounters["READY"]["HREF"]); 6345 $(".basket_fly .opener .basket_count") 6346 .attr("title", $("<div/>").html(arBasketAsproCounters.READY.TITLE).text()) 6347 .attr( 6348 "class", 6349 "colored_theme_hover_text basket_count small clicked" + (arBasketAsproCounters.READY.COUNT > 0 ? "" : " empty") 6350 ); 6351 6352 updateBottomIconsPanel(arBasketAsproCounters); 6353 } 6354}; 6355 6356CheckHeaderFixed = function () { 6357 var header = $("header, body.simple_basket_mode #header").first(), 6358 header_fixed = $("#headerfixed, body.simple_basket_mode #header"), 6359 header_simple = $("body.simple_basket_mode #header"); 6360 6361 if (header_fixed.length) { 6362 if (header.length) { 6363 var isHeaderFixed = false, 6364 isTabsFixed = false, 6365 headerCanFix = true, 6366 headerFixedHeight = header_fixed.actual("outerHeight"), 6367 headerNormalHeight = header.actual("outerHeight"), 6368 headerDiffHeight = headerNormalHeight - headerFixedHeight, 6369 mobileBtnMenu = $(".btn.btn-responsive-nav"), 6370 headerTop = $("#panel:visible").actual("outerHeight"), 6371 topBlock = $(".TOP_HEADER").first(), 6372 $headerFixedNlo = header_fixed.find("[data-nlo]"), 6373 isNloLoaded = !$headerFixedNlo.length, 6374 OnHeaderFixedScrollHandler; 6375 6376 if (headerDiffHeight <= 0) headerDiffHeight = 0; 6377 6378 if (topBlock.length) headerTop += topBlock.actual("outerHeight"); 6379 6380 $(window).scroll( 6381 (OnHeaderFixedScrollHandler = function () { 6382 var tabs_fixed = $(".product-item-detail-tabs-container-fixed"); 6383 6384 if (window.matchMedia("(min-width:992px)").matches) { 6385 var scrollTop = documentScrollTopLast, 6386 current_is = $(".search-wrapper .search-input:visible"), 6387 tabs = $(".ordered-block .nav.nav-tabs"), 6388 headerCanFix = !mobileBtnMenu.is(":visible"); 6389 6390 if (!isHeaderFixed) { 6391 if (headerCanFix && scrollTop > headerNormalHeight + headerTop) { 6392 if (!isNloLoaded) { 6393 if (!$headerFixedNlo.hasClass("nlo-loadings")) { 6394 $headerFixedNlo.addClass("nlo-loadings"); 6395 setTimeout(function () { 6396 $.ajax({ 6397 data: { 6398 nlo: $headerFixedNlo.attr("data-nlo"), 6399 }, 6400 success: function (response) { 6401 // stop ya metrika webvisor DOM indexer 6402 pauseYmObserver(); 6403 6404 isNloLoaded = true; 6405 $headerFixedNlo[0].insertAdjacentHTML("beforebegin", $.trim(response)); 6406 $headerFixedNlo.remove(); 6407 6408 InitMenuNavigationAim(); 6409 OnHeaderFixedScrollHandler(); 6410 6411 // resume ya metrika webvisor 6412 // (300ms transition) + (100ms scroll handler) 6413 setTimeout(resumeYmObserver, 400); 6414 }, 6415 error: function () { 6416 $headerFixedNlo.removeClass("nlo-loadings"); 6417 }, 6418 }); 6419 }, 300); 6420 } 6421 } else { 6422 isHeaderFixed = true; 6423 if (header_simple.length) { 6424 headerSimpleHeight = header_simple.actual("outerHeight"); 6425 header_simple.closest(".header_wrap").css({ 6426 "margin-top": headerSimpleHeight, 6427 }); 6428 } 6429 header_fixed.addClass("fixed"); 6430 6431 $("nav.mega-menu.sliced.initied").removeClass("initied"); 6432 CheckTopMenuDotted(); 6433 } 6434 } 6435 } 6436 if (isHeaderFixed || !headerCanFix) { 6437 if (!headerCanFix || scrollTop <= headerDiffHeight + headerTop) { 6438 isHeaderFixed = false;
6439 header_fixed.removeClass("fixed"); 6440 if (header_simple.length) { 6441 header_simple.closest(".header_wrap").css({ "margin-top": "" }); 6442 } 6443 } 6444 } 6445 6446 //fixed tabs 6447 if (tabs_fixed.length && tabs.length) { 6448 var tabs_offset = $(".ordered-block .nav.nav-tabs").offset(); 6449 if (scrollTop + headerFixedHeight > tabs_offset.top) { 6450 tabs_fixed.css({ 6451 top: header_fixed.actual("outerHeight"), 6452 }); 6453 tabs_fixed.addClass("fixed"); 6454 6455 header_fixed.addClass("tabs-fixed"); 6456 } else if (tabs_fixed.hasClass("fixed")) { 6457 tabs_fixed.removeAttr("style"); 6458 tabs_fixed.removeClass("fixed"); 6459 6460 header_fixed.removeClass("tabs-fixed"); 6461 } 6462 } 6463 } 6464 }) 6465 ); 6466 } 6467 } 6468 6469 //mobile fixed 6470 var headerSimple = $("body.simple_basket_mode .wrapper1.mfixed_Y #header"); 6471 var mfixed = headerSimple.length ? headerSimple : $(".wrapper1.mfixed_Y #mobileheader"); 6472 if (mfixed.length && isMobile) { 6473 var isMHeaderFixed = false, 6474 mheaderCanFix = true, 6475 mheaderFixedHeight = mfixed.actual("outerHeight"), 6476 // mheaderFixedHeight = 0, 6477 mheaderTop = $("#panel:visible").actual("outerHeight"), 6478 mHeaderScrollTop = $(".wrapper1").hasClass("mfixed_view_scroll_top"); 6479 $(window).scroll(function () { 6480 var scrollTop = documentScrollTopLast; 6481 if (window.matchMedia("(max-width:991px)").matches) { 6482 if (mHeaderScrollTop) { 6483 if (scrollTop > startScroll) { 6484 if (!$("#mobilePhone.show").length) { 6485 mfixed.removeClass("fixed"); 6486 if (headerSimple.length) { 6487 headerSimple.closest(".header_wrap").css({ "margin-top": "" }); 6488 } 6489 } 6490 } else if (scrollTop > mheaderFixedHeight + mheaderTop) { 6491 mfixed.addClass("fixed"); 6492 if (headerSimple.length) { 6493 headerSimple.closest(".header_wrap").css({ "margin-top": mheaderFixedHeight }); 6494 } 6495 } else if (scrollTop <= mheaderFixedHeight + mheaderTop) { 6496 mfixed.removeClass("fixed"); 6497 if (headerSimple.length) { 6498 headerSimple.closest(".header_wrap").css({ "margin-top": "" }); 6499 } 6500 } 6501 startScroll = scrollTop; 6502 } else { 6503 if (!isMHeaderFixed) { 6504 if (scrollTop > mheaderFixedHeight + mheaderTop) { 6505 isMHeaderFixed = true; 6506 mfixed.addClass("fixed"); 6507 if (headerSimple.length) { 6508 headerSimple.closest(".header_wrap").css({ "margin-top": mheaderFixedHeight }); 6509 } 6510 } 6511 } else if (isMHeaderFixed) { 6512 if (scrollTop <= mheaderFixedHeight + mheaderTop) { 6513 isMHeaderFixed = false; 6514 mfixed.removeClass("fixed"); 6515 if (headerSimple.length) { 6516 headerSimple.closest(".header_wrap").css({ "margin-top": "" }); 6517 } 6518 } 6519 } 6520 } 6521 } else { 6522 mfixed.removeClass("fixed"); 6523 if (headerSimple.length) { 6524 headerSimple.closest(".header_wrap").css({ "margin-top": "" }); 6525 } 6526 } 6527 }); 6528 } 6529}; 6530 6531CheckHeaderFixedMenu = function () { 6532 if ( 6533 arAsproOptions["THEME"] && 6534 arAsproOptions["THEME"]["HEADER_FIXED"] == 2 && 6535 $("#headerfixed .js-nav").length && 6536 window.matchMedia("(min-width: 992px)").matches 6537 ) { 6538 $("#headerfixed .js-nav").css("width", "0"); 6539 var all_width = 0, 6540 cont_width = $("#headerfixed .maxwidth-theme").actual("width"), 6541 padding_menu = 6542 $("#headerfixed .logo-row.v2 .menu-block").actual("outerWidth") - 6543 $("#headerfixed .logo-row.v2 .menu-block").actual("width"); 6544 $("#headerfixed .logo-row.v2 > .inner-table-block").each(function () { 6545 if (!$(this).hasClass("menu-block")) all_width += $(this).actual("outerWidth"); 6546 }); 6547 $("#headerfixed .js-nav").width(cont_width - all_width - padding_menu); 6548 } 6549}; 6550 6551CheckSearchWidth = function () { 6552 if ($(".logo_and_menu-row .search_wrap").length) { 6553 var searchPosition = $(".logo_and_menu-row .search_wrap").position().left, 6554 maxWidth = $(".logo_and_menu-row .maxwidth-theme").width() - 2; 6555 width = 0; 6556 if ($(".logo_and_menu-row .subtop .search_wrap").length) { 6557 maxWidth = $(".logo_and_menu-row .subtop").width() - 2; 6558 $(".logo_and_menu-row .subtop > .row >div >div") 6559 .each(function () { 6560 if (!$(this).hasClass("search_wrap")) { 6561 var elementWidth = $(this).outerWidth(); 6562 if (!$(this).is(":visible") || !$(this).height()) elementWidth = 0; 6563 width = width ? width - elementWidth : maxWidth - elementWidth; 6564 } 6565 }) 6566 .promise() 6567 .done(function () { 6568 if ($(".logo_and_menu-row .search_wrap.wide_search").length) 6569 $(".logo_and_menu-row .search_wrap .search-block").outerWidth(width); 6570 else $(".logo_and_menu-row .search_wrap").outerWidth(width); 6571 $(".logo_and_menu-row .search_wrap").css({ 6572 opacity: 1, 6573 visibility: "visible", 6574 }); 6575 }); 6576 } else {
6577 if ($(".logo_and_menu-row .subbottom .search_wrap").length) { 6578 maxWidth = $(".logo_and_menu-row .subbottom").width() - 2; 6579 $(".logo_and_menu-row .subbottom >div") 6580 .each(function () { 6581 if (!$(this).hasClass("search_wrap")) { 6582 var elementWidth = $(this).outerWidth(); 6583 if (!$(this).is(":visible") || !$(this).height()) elementWidth = 0; 6584 width = width ? width - elementWidth : maxWidth - elementWidth; 6585 } 6586 }) 6587 .promise() 6588 .done(function () { 6589 if ($(".logo_and_menu-row .search_wrap.wide_search").length) 6590 $(".logo_and_menu-row .search_wrap .search-block").outerWidth(width); 6591 else $(".logo_and_menu-row .search_wrap").outerWidth(width); 6592 $(".logo_and_menu-row .search_wrap").css({ 6593 opacity: 1, 6594 visibility: "visible", 6595 }); 6596 }); 6597 } else { 6598 $(".logo_and_menu-row .maxwidth-theme > .row >div >div") 6599 .each(function () { 6600 if (!$(this).hasClass("search_wrap")) { 6601 var elementWidth = $(this).outerWidth(); 6602 if (!$(this).is(":visible") || !$(this).height()) elementWidth = 0; 6603 width = width ? width - elementWidth : maxWidth - elementWidth; 6604 } 6605 }) 6606 .promise() 6607 .done(function () { 6608 if ($(".logo_and_menu-row .search_wrap.wide_search").length) 6609 $(".logo_and_menu-row .search_wrap .search-block").outerWidth(width); 6610 else $(".logo_and_menu-row .search_wrap").outerWidth(width); 6611 $(".logo_and_menu-row .search_wrap").css({ 6612 opacity: 1, 6613 visibility: "visible", 6614 }); 6615 }); 6616 } 6617 } 6618 } 6619}; 6620 6621if (!funcDefined("showItemStoresAmount")) { 6622 var showItemStoresAmount = function () { 6623 let blocks = $(".item-stock .status-amount--stores:not(.status-amount--loaded)"); 6624 if (blocks.length) { 6625 let stores = []; 6626 let ids = []; 6627 6628 for (let i = 0, cnt = blocks.length; i < cnt; ++i) { 6629 $(blocks[i]).addClass("status-amount--loaded"); 6630 6631 var data = $(blocks[i]).data("param-amount"); 6632 if (typeof data === "object" && data) { 6633 ids.push(data.ID); 6634 stores = data.STORES; 6635 } 6636 } 6637 6638 if (ids) { 6639 let data = { 6640 ids: ids, 6641 stores: stores, 6642 }; 6643 6644 $.ajax({ 6645 url: arAsproOptions.SITE_DIR + "ajax/amount.php", 6646 type: "POST", 6647 data: data, 6648 dataType: "json", 6649 success: function (result) { 6650 if (typeof result === "object" && result && result.success && result.amount) { 6651 for (let i = 0, cnt = blocks.length; i < cnt; ++i) { 6652 var data = $(blocks[i]).data("param-amount"); 6653 if (typeof data === "object" && data) { 6654 if (result.amount[data.ID]) { 6655 $(blocks[i]).html(result.amount[data.ID]); 6656 } 6657 6658 $(blocks[i]).addClass("status-amount--visible"); 6659 } 6660 } 6661 } 6662 }, 6663 }); 6664 } 6665 } 6666 }; 6667} 6668 6669lazyLoadPagenBlock = function () { 6670 setTimeout(function () { 6671 if ($(".with-load-block .ajax_load_btn:not(.appear-block)").length) { 6672 $(".with-load-block .ajax_load_btn:not(.appear-block)").iAppear( 6673 function () { 6674 var $this = $(this); 6675 $this.addClass("appear-block").trigger("click"); 6676 }, 6677 { rootMargin: "200px 0px 200px 0px", accX: 0, accY: 200 } 6678 ); 6679 } 6680 }, 200); 6681}; 6682 6683scrollPreviewBlock = function () { 6684 if (typeof $.cookie("scroll_block") != "undefined" && $.cookie("scroll_block")) { 6685 var scroll_block = $($.cookie("scroll_block")); 6686 if (scroll_block.length) { 6687 let position = scroll_block.offset().top; 6688 let $fixedHeader = null; 6689 if (($fixedHeader = document.getElementById("headerfixed"))) { 6690 position -= $fixedHeader.clientHeight; 6691 } 6692 $("body, html").animate({ scrollTop: position }, 500); 6693 } 6694 $.cookie("scroll_block", null); 6695 } 6696}; 6697 6698scrollToBlock = function (block) { 6699 if ($(block).length) { 6700 var offset = $(block).offset().top; 6701 if (typeof $(block).data("toggle") != "undefined") $(block).click(); 6702 6703 if (typeof $(block).data("offset") != "undefined") offset += $(block).data("offset"); 6704 6705 $("body, html").animate({ scrollTop: offset }, 500); 6706 } 6707}; 6708 6709checkMenuLines = function () { 6710 if ($(".front_page .menu-row .left_border").length || $(".front_page .menu-row .right_border").length) { 6711 var positionMenu = $(".centered .menu-row .mega-menu table").length 6712 ? $(".centered .menu-row .mega-menu table").offset().left 6713 : 0, 6714 varFixLineWidth = 6715 $("body").hasClass("with_decorate") && window.matchMedia("(min-width: 1100px)").matches ? 126 : 7; 6716 6717 $(".menu-row .left_border, .menu-row .right_border").css("width", positionMenu - varFixLineWidth); 6718 } 6719}; 6720 6721SetFixedAskBlock = function () { 6722 if ($(".ask_a_question_wrapper").length) { 6723 var offset = $(".ask_a_question_wrapper").offset(), 6724 footer_offset = 0, 6725 block = $(".ask_a_question_wrapper").find(".ask_a_question"), 6726 block_offset = BX.pos(block[0]), 6727 block_height = block_offset.bottom - block_offset.top, 6728 diff_top_scroll = $("#headerfixed").height() + 20; 6729 6730 if ($("footer").length) footer_offset = $("footer").offset().top; 6731 6732 if ($(".banner.CONTENT_BOTTOM").length) footer_offset = $(".banner.CONTENT_BOTTOM").offset().top; 6733 6734 if (block_height + diff_top_scroll + documentScrollTopLast + 130 > footer_offset) { 6735 block.removeClass("fixed").css({ top: "auto", width: "auto", bottom: 0 }); 6736 block.parent().css("position", "static"); 6737 block.parent().parent().css("position", "static"); 6738 } else { 6739 block.parent().removeAttr("style"); 6740 block.parent().parent().removeAttr("style"); 6741 6742 if (documentScrollTopLast + diff_top_scroll > offset.top) { 6743 var fixed_width = $(".fixed_block_fix").width(); 6744 block.addClass("fixed").css({ top: diff_top_scroll, bottom: "auto" }); 6745 if (fixed_width) block.css({ width: $(".fixed_block_fix").width() }); 6746 } else block.removeClass("fixed").css({ top: 0, width: "auto" }); 6747 } 6748 } 6749}; 6750 6751MegaMenuFixed = function () { 6752 var animationTime = 150, 6753 $megaFixedNlo = $(".mega_fixed_menu").find("[data-nlo]"); 6754 6755 $("header .burger, #headerfixed .burger").on("click", function () { 6756 if ($megaFixedNlo.length) { 6757 if (!$megaFixedNlo.hasClass("nlo-loadings")) { 6758 $megaFixedNlo.addClass("nlo-loadings"); 6759 setTimeout(function () { 6760 $.ajax({ 6761 data: { nlo: $megaFixedNlo.attr("data-nlo") }, 6762 success: function (response) { 6763 $megaFixedNlo[0].insertAdjacentHTML("beforebegin", $.trim(response)); 6764 $megaFixedNlo.remove(); 6765 }, 6766 error: function () { 6767 $megaFixedNlo.removeClass("nlo-loadings"); 6768 }, 6769 }); 6770 }, 300); 6771 } 6772 } 6773 6774 $(".mega_fixed_menu").fadeIn(animationTime); 6775 }); 6776 6777 $(".mega_fixed_menu .svg.svg-close").on("click", function () { 6778 $(this).closest(".mega_fixed_menu").fadeOut(animationTime); 6779 //$('.header_wrap').toggleClass('zindexed'); 6780 }); 6781 6782 $(".mega_fixed_menu .dropdown-menu .arrow").on("click", function (e) { 6783 e.preventDefault(); 6784 e.stopPropagation(); 6785 $(this).closest(".dropdown-submenu").find(".dropdown-menu").slideToggle(animationTime); 6786 $(this).closest(".dropdown-submenu").addClass("opened"); 6787 }); 6788}; 6789 6790CheckPopupTop = function () {}; 6791 6792AjaxClickLink = function (e) { 6793 var _this = "", 6794 container = $(".js-load-wrapper"), 6795 container_inner = $(".js-load-wrapper").find(".ajax_load"), 6796 dopAction = ""; 6797 url = ""; 6798 if ("preventDefault" in e) { 6799 e.preventDefault();
6800 _this = $(e.target).hasClass("js-load-link") ? $(e.target) : $(e.target).closest(".js-load-link"); 6801 } else { 6802 _this = $(e); 6803 dopAction = "Y"; 6804 } 6805 6806 if (container.length) { 6807 var objUrl = parseUrlQuery(), 6808 obGetData = { ajax_get_filter: "Y", control_ajax: "Y" }; 6809 6810 obGetData.bitrix_include_areas = "N"; 6811 6812 if ("clear_cache" in objUrl) { 6813 if (objUrl.clear_cache == "Y") { 6814 obGetData.clear_cache = "Y"; 6815 } 6816 } 6817 6818 if (container_inner.length) { 6819 container_inner.addClass("loading-state"); 6820 } else { 6821 container.addClass("loading-state"); 6822 } 6823 6824 if (_this.data("url")) { 6825 url = _this.data("url"); 6826 } 6827 6828 if (_this.data("click_block") && $(_this.data("click_block")).length) { 6829 if ($(_this.data("click_block")).data("url")) { 6830 url = $(_this.data("click_block")).data("url"); 6831 } 6832 } 6833 6834 if (dopAction) { 6835 BX.PopupWindowManager.getCurrentPopup().close(); 6836 $(".bx_filter_select_popup ul li .sort_btn").removeClass("current"); 6837 _this.addClass("current"); 6838 _this.closest(".bx_filter_block").find(".bx_filter_select_text").text(_this.text()); 6839 } 6840 6841 $(".bx_filter .bx_sort_filter .bx_filter_select_text").text(_this.text()); 6842 $(".bx_filter .bx_sort_filter .bx_filter_select_popup ul li span.current").removeClass("current"); 6843 $(".bx_filter .bx_sort_filter .bx_filter_select_popup ul li") 6844 .eq(_this.parent().index()) 6845 .find("span") 6846 .addClass("current"); 6847 6848 $.ajax({ 6849 url: url, 6850 data: obGetData, 6851 success: function (html) { 6852 container.html(html); 6853 6854 if (container_inner.length) container_inner.removeClass("loading-state"); 6855 else container.removeClass("loading-state"); 6856 6857 initAnimateLoad(); 6858 6859 var eventdata = { action: "jsLoadBlock" }; 6860 BX.onCustomEvent("onCompleteAction", [eventdata, _this]); 6861 6862 BX.onCustomEvent("onHeaderProgressBarChange", [{}]); 6863 6864 initSelects(document); 6865 // InitCustomScrollBar(); 6866 // InitScrollBar(); 6867 6868 if (window.FilterHelper !== undefined) { 6869 FilterHelper.resultDiv = $("#filter-helper"); 6870 FilterHelper.show(); 6871 } 6872 }, 6873 }); 6874 } 6875}; 6876 6877initCalculatePreview = function (removeAppearAttr) { 6878 $(".calculate-delivery.with_preview:not(.inited)").each(function () { 6879 if (removeAppearAttr) { 6880 $(this).attr("data-i-appeared", ""); 6881 } 6882 var $this = $(this); 6883 var $calculateSpan = $this.find("span[data-event=jqm]"); 6884 var $preview = $this.find(".calculate-delivery-preview"); 6885 6886 $this.addClass("inited"); 6887 $this.iAppear( 6888 function () { 6889 if ($calculateSpan.length) { 6890 if (typeof window["calculate-delivery-preview-index"] === "undefined") { 6891 window["calculate-delivery-preview-index"] = 1001; 6892 } else { 6893 ++window["calculate-delivery-preview-index"]; 6894 } 6895 6896 var productId = $calculateSpan.attr("data-param-product_id") * 1; 6897 var quantity = $calculateSpan.attr("data-param-quantity") * 1; 6898 6899 if (productId > 0) { 6900 var areaIndexSended = window["calculate-delivery-preview-index"]; 6901 $calculateSpan.data({ areaIndex: areaIndexSended }); 6902 6903 $.ajax({ 6904 url: arAsproOptions["SITE_DIR"] + "ajax/delivery.php", 6905 type: "POST", 6906 data: { 6907 is_preview: "Y", 6908 index: areaIndexSended, 6909 product_id: productId, 6910 quantity: quantity, 6911 }, 6912 beforeSend: function () { 6913 $this.addClass("loadings"); 6914 }, 6915 success: function (response) { 6916 var areaIndex = $calculateSpan.data("areaIndex"); 6917 if (typeof areaIndex !== "undefined" && areaIndex == areaIndexSended) { 6918 $calculateSpan.hide(); 6919 $preview.html(response); 6920 if (!$preview.find(".catalog-delivery-preview").length) { 6921 $preview.empty(); 6922 $calculateSpan.show(); 6923 } 6924 } 6925 }, 6926 error: function (xhr, ajaxOptions, thrownError) {}, 6927 complete: function () { 6928 var areaIndex = $calculateSpan.data("areaIndex"); 6929 if (typeof areaIndex !== "undefined" && areaIndex == areaIndexSended) { 6930 $this.removeClass("loadings"); 6931 } 6932 }, 6933 }); 6934 } 6935 } 6936 }, 6937 { accX: 0, accY: 0 } 6938 ); 6939 }); 6940}; 6941 6942/* set price item */ 6943if (!funcDefined("setPriceItem")) { 6944 var setPriceItem = function setPriceItem( 6945 main_block, 6946 quantity, 6947 rewrite_price, 6948 check_quantity, 6949 is_sku, 6950 show_percent, 6951 percent 6952 ) { 6953 var old_quantity = main_block.find(".to-cart").attr("data-ratio"), 6954 value = 6955 typeof rewrite_price !== "undefined" && rewrite_price 6956 ? rewrite_price 6957 : main_block.find(".to-cart").attr("data-value"), 6958 currency = main_block.find(".to-cart").attr("data-currency"), 6959 total_block = 6960 '<div class="total_summ" style="display:none;"><div>' +
6961 BX.message("TOTAL_SUMM_ITEM") + 6962 "<span></span></div></div>", 6963 price_block = main_block.find(".cost.prices"), 6964 use_percent = typeof show_percent !== "undefined" && show_percent == "Y", 6965 percent_number = typeof percent !== "undefined" && percent, 6966 sku_checked = main_block.find(".has_offer_prop").length ? "Y" : "N", 6967 check = typeof check_quantity !== "undefined" && check_quantity; 6968 6969 if (main_block.find(".wrapp-one-click").length) { 6970 if (!main_block.find(".total_summ").length && !is_sku) 6971 $(total_block).insertAfter(main_block.find(".wrapp-one-click")); 6972 } else if (main_block.find(".buy_block").length) { 6973 if (!main_block.find(".buy_block .total_summ").length && !is_sku) 6974 $(total_block).appendTo(main_block.find(".buy_block")); 6975 } else if (main_block.find(".counter_wrapp").length) { 6976 if (!main_block.find(".total_summ").length && !is_sku) 6977 $(total_block).appendTo(main_block.find(".counter_wrapp:first")); 6978 } 6979 if (main_block.find(".total_summ").length) { 6980 if (value && currency) { 6981 if ((1 == quantity && old_quantity == quantity) || (typeof is_sku !== "undefined" && is_sku && !check)) { 6982 main_block.find(".total_summ").slideUp(50); 6983 } else { 6984 main_block.find(".total_summ span").html(BX.Currency.currencyFormat(value * quantity, currency, true)); 6985 if (main_block.find(".total_summ").is(":hidden")) main_block.find(".total_summ").slideDown(100); 6986 } 6987 } else { 6988 main_block.find(".total_summ").slideUp(100); 6989 } 6990 } 6991 }; 6992} 6993 6994if (!funcDefined("getCurrentPrice")) { 6995 var getCurrentPrice = function getCurrentPrice(price, currency, print_price) { 6996 var val = ""; 6997 var format_value = BX.Currency.currencyFormat(price, currency); 6998 if (print_price.indexOf(format_value) >= 0) { 6999 val = print_price.replace( 7000 format_value, 7001 '<span class="price_value">' + format_value + '</span><span class="price_currency">' 7002 ); 7003 val += "</span>"; 7004 } else { 7005 val = print_price; 7006 } 7007 7008 return val; 7009 }; 7010} 7011 7012if (!funcDefined("initAnimateLoad")) { 7013 var initAnimateLoad = function initAnimateLoad() { 7014 $(".animate-load").click(function () { 7015 if (!jQuery.browser.mobile) { 7016 $(this).parent().addClass("loadings"); 7017 } 7018 }); 7019 }; 7020} 7021 7022if (!funcDefined("showBasketShareBtn")) { 7023 var showBasketShareBtn = function () { 7024 if (arAsproOptions["THEME"]["SHOW_SHARE_BASKET"] === "Y") { 7025 if (!document.querySelector(".basket-checkout-block-btns")) { 7026 var checkout = document.querySelector(".basket-checkout-section-inner"); 7027 if (checkout) { 7028 var btns = BX.create({ 7029 tag: "div", 7030 attrs: { 7031 class: "basket-checkout-block basket-checkout-block-btns", 7032 }, 7033 html: '<div class="basket-checkout-block-btns-wrap"></div>', 7034 }); 7035 7036 BX.insertAfter(btns, BX.lastChild(checkout)); 7037 var btnsWrap = btns.querySelector(".basket-checkout-block-btns-wrap"); 7038 7039 var btnCheckout = checkout.querySelector(".basket-checkout-block-btn"); 7040 if (btnCheckout) { 7041 btnsWrap.appendChild(btnCheckout); 7042 } 7043 7044 var btnFastOrder = checkout.querySelector(".fastorder"); 7045 if (btnFastOrder) { 7046 btnsWrap.appendChild(btnFastOrder); 7047 } 7048 7049 if ($(".basket-btn-checkout").length && !$(".basket-btn-checkout").hasClass("disabled")) { 7050 var btnShareBasket = BX.create({ 7051 tag: "div", 7052 attrs: { 7053 class: "basket-checkout-block basket-checkout-block-share colored_theme_hover_bg-block", 7054 title: arAsproOptions["THEME"]["EXPRESSION_FOR_SHARE_BASKET"], 7055 }, 7056 html: 7057 '<span class="animate-load" data-event="jqm" data-param-form_id="share_basket" data-name="share_basket"><i class="svg colored_theme_hover_bg-el-svg"><svg class="svg svg-share" xmlns="http://www.w3.org/2000/svg" width="14" height="16" viewBox="0 0 14 16"><path data-name="Ellipse 223 copy 8" d="M1613,203a2.967,2.967,0,0,1-1.86-.661l-3.22,2.01a2.689,2.689,0,0,1,0,1.3l3.22,2.01A2.961,2.961,0,0,1,1613,207a3,3,0,1,1-3,3,3.47,3.47,0,0,1,.07-0.651l-3.21-2.01a3,3,0,1,1,0-4.678l3.21-2.01A3.472,3.472,0,0,1,1610,200,3,3,0,1,1,1613,203Zm0,8a1,1,0,1,0-1-1A1,1,0,0,0,1613,211Zm-8-7a1,1,0,1,0,1,1A1,1,0,0,0,1605,204Zm8-5a1,1,0,1,0,1,1A1,1,0,0,0,1613,199Z" transform="translate(-1602 -197)" fill="#B8B8B8"></path></svg></i><span class="title">' + 7058 arAsproOptions["THEME"]["EXPRESSION_FOR_SHARE_BASKET"] + 7059 "</span></span>", 7060 }); 7061 7062 btnsWrap.appendChild(btnShareBasket); 7063 initAnimateLoad(); 7064 } 7065 } 7066 } 7067 } 7068 }; 7069} 7070 7071if (!funcDefined("showBasketHeadingBtn")) { 7072 var showBasketHeadingBtn = function () { 7073 if (document.querySelector(".page-top h1")) { 7074 var topicHeading = document.querySelector(".page-top .topic .topic__heading"); 7075 if (topicHeading) { 7076 if (arAsproOptions["THEME"]["SHOW_BASKET_PRINT"] === "Y") { 7077 if (!document.querySelector(".btn_basket_heading--print")) { 7078 var btnPrintBasket = BX.create({ 7079 tag: "div", 7080 attrs: { 7081 class: "btn_basket_heading btn_basket_heading--print print-link colored_theme_hover_bg-block", 7082 title: arAsproOptions["THEME"]["EXPRESSION_FOR_PRINT_PAGE"], 7083 }, 7084 html: '<i class="svg colored_theme_hover_bg-el-svg"><svg class="svg svg-print" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewB
7084ox="0 0 16 16"><path id="Rectangle_665_copy_4" data-name="Rectangle 665 copy 4" class="cls-print" d="M1570,210h-2v3h-8v-3h-2a2,2,0,0,1-2-2v-5a2,2,0,0,1,2-2h2v-4h8v4h2a2,2,0,0,1,2,2v5A2,2,0,0,1,1570,210Zm-8,1h4v-4h-4v4Zm4-12h-4v2h4v-2Zm4,4h-12v5h2v-3h8v3h2v-5Z" transform="translate(-1556 -197)"></path></svg></i>', 7085 }); 7086 BX.insertBefore(btnPrintBasket, topicHeading); 7087 } 7088 } 7089 7090 if ($(".basket-btn-checkout").length && !$(".basket-btn-checkout").hasClass("disabled")) { 7091 // if(arAsproOptions['THEME']['SHOW_SEND_BASKET_2EMAIL'] === 'Y'){ 7092 // if(!document.querySelector('.btn_basket_heading--send2email')){ 7093 // var btnSendBasket2Email = BX.create({ 7094 // tag: 'div', 7095 // attrs: { 7096 // class: 'btn_basket_heading btn_basket_heading--with_title btn_basket_heading--send2email colored_theme_hover_bg-block', 7097 // title: arAsproOptions['THEME']["EXPRESSION_FOR_SEND_BASKET_2EMAIL"], 7098 // }, 7099 // html: '<i class="svg colored_theme_hover_bg-el-svg"><svg class="svg" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H4H12H13V1V3.125L15.06 4.4125C15.6448 4.77798 16 5.41892 16 6.1085V6.98162C16.0002 6.99325 16.0002 7.00488 16 7.01649V14C16 15.1046 15.1046 16 14 16H2C0.895429 16 -1.43918e-06 15.1046 -1.43918e-06 14V7.01644C-0.000202747 7.00486 -0.000203195 6.99327 -1.43918e-06 6.98167V6.1085C-1.43918e-06 5.41892 0.355238 4.77798 0.940001 4.4125L3 3.125V1V0ZM5 4.2335L5 2H11V7L11 8.23381L9.62943 9.05615L8.64018 8.23178C8.26934 7.92274 7.73066 7.92274 7.35981 8.23178L6.37057 9.05615L5 8.23381V4.2335ZM2 6.1085L3 5.4835V7.03381L2 6.43381V6.1085ZM14 6.1085L13 5.4835V7.03381L14 6.43381V6.1085ZM12.4379 14L8 10.3017L3.56205 14H12.4379ZM14 12.6983V8.76619L11.2567 10.4122L14 12.6983ZM2 8.76619V12.6983L4.74333 10.4122L2 8.76619Z" fill="#B8B8B8"/></svg></i><span class="title">' + arAsproOptions['THEME']["EXPRESSION_FOR_SEND_BASKET_2EMAIL"] + '</span>', 7100 // }); 7101 // BX.insertBefore(btnSendBasket2Email, topicHeading); 7102 // } 7103 // } 7104 7105 if (arAsproOptions["THEME"]["SHOW_DOWNLOAD_BASKET"] === "Y") { 7106 if (!document.querySelector(".btn_basket_heading--download")) { 7107 var btnDownloadBasket = BX.create({ 7108 tag: "div", 7109 attrs: { 7110 class: 7111 "btn_basket_heading btn_basket_heading--with_title btn_basket_heading--download colored_theme_hover_bg-block", 7112 title: arAsproOptions["THEME"]["EXPRESSION_FOR_DOWNLOAD_BASKET"], 7113 }, 7114 events: { 7115 click: BX.proxy(function (e) { 7116 if (!e) { 7117 e = window.event; 7118 } 7119 7120 BX.PreventDefault(e); 7121 7122 var button = e.target.closest(".btn_basket_heading"); 7123 if (button) { 7124 if (BX.hasClass(button, "loadings")) { 7125 return; 7126 } 7127 7128 BX.addClass(button, "loadings"); 7129 setTimeout(function () { 7130 BX.removeClass(button, "loadings"); 7131 }, 2000); 7132 } 7133 7134 location.href = 7135 arAsproOptions["SITE_DIR"] + 7136 "ajax/download_basket.php?params[type]=" + 7137 arAsproOptions["THEME"]["BASKET_FILE_DOWNLOAD_TEMPLATE"]; 7138 }, this), 7139 }, 7140 html: 7141 '<i class="svg colored_theme_hover_bg-el-svg"><svg class="svg" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5 14H14L14 6H11H10V5V2H5V6H7H9V8V10V12H7H5V14ZM13.6716 4L12 2.32843V4H13.6716ZM6 8H7V10H6H5H3H2V8H3H5H6ZM3 6H2H0V8V10V12H2H3V14V16H5H14H16V14V4.32843C16 3.79799 15.7893 3.28929 15.4142 2.91421L13.0858 0.585786C12.7107 0.210714 12.202 0 11.6716 0H5H3V2V6Z" fill="#B8B8B8"/></svg></i><span class="title">' + 7142 arAsproOptions["THEME"]["EXPRESSION_FOR_DOWNLOAD_BASKET"] + 7143 "</span>", 7144 }); 7145 BX.insertBefore(btnDownloadBasket, topicHeading); 7146 } 7147 } 7148 } else { 7149 BX.remove(document.querySelector(".btn_basket_heading--send2email")); 7150 BX.remove(document.querySelector(".btn_basket_heading--download")); 7151 } 7152 7153 var eventdata = { parent: topicHeading }; 7154 BX.onCustomEvent("onShowBasketHeadingBtn", [eventdata]); 7155 } 7156 } 7157 }; 7158} 7159 7160$(window).on("load", function () { 7161 //check width for menu and search
7162 //CheckSearchWidth(); 7163}); 7164 7165$(document).ready(function () { 7166 MegaMenuFixed(); 7167 // InitScrollBar(); 7168 7169 /* ripple effect for buttons */ 7170 $.ripple(".btn", { 7171 debug: false, // Turn Ripple.js logging on/off 7172 on: "mouseenter", // The event to trigger a ripple effect 7173 7174 opacity: 0.4, // The opacity of the ripple 7175 color: "auto", // Set the background color. If set to "auto", it will use the text color 7176 multi: true, // Allow multiple ripples per element 7177 7178 duration: 0.6, // The duration of the ripple 7179 7180 easing: "linear", // The CSS3 easing function of the ripple 7181 }); 7182 /* ripple end */ 7183 7184 //ecommerce order 7185 if (arAsproOptions["PAGES"]["ORDER_PAGE"]) { 7186 var arUrl = parseUrlQuery(); 7187 if ("ORDER_ID" in arUrl) { 7188 var _id = arUrl["ORDER_ID"]; 7189 if (arAsproOptions["COUNTERS"]["USE_FULLORDER_GOALS"] !== "N") { 7190 var eventdata = { goal: "goal_order_success", result: _id }; 7191 BX.onCustomEvent("onCounterGoals", [eventdata]); 7192 } 7193 if (checkCounters()) { 7194 if (typeof localStorage !== "undefined") { 7195 var val = localStorage.getItem("gtm_e_" + _id), 7196 d = ""; 7197 try { 7198 d = JSON.parse(val); 7199 } catch (e) { 7200 d = val; 7201 } 7202 if (typeof d === "object") { 7203 window.dataLayer = window.dataLayer || []; 7204 dataLayer.push({ 7205 event: arAsproOptions["COUNTERS"]["GOOGLE_EVENTS"]["PURCHASE"], 7206 ecommerce: d, 7207 }); 7208 } 7209 7210 if (typeof localStorage !== "undefined") { 7211 localStorage.removeItem("gtm_e_" + _id); 7212 } 7213 } 7214 } 7215 } 7216 } 7217 var bSafary = false; 7218 if (typeof jQuery.browser == "object") bSafary = jQuery.browser.safari; 7219 else if (typeof browser == "object") bSafary = browser.safari; 7220 if (!bSafary) { 7221 CheckTopMenuDotted(); 7222 CheckHeaderFixed(); 7223 checkMenuLines(); 7224 } else { 7225 setTimeout(function () { 7226 $(window).resize(); // need to check resize flexslider & menu 7227 setTimeout(function () { 7228 CheckTopMenuDotted(); 7229 CheckHeaderFixed(); 7230 checkMenuLines(); 7231 7232 setTimeout(function () { 7233 $(window).scroll(); 7234 }, 50); 7235 }, 50); 7236 }, 350); 7237 } 7238 7239 showItemStoresAmount(); 7240 7241 if (arAsproOptions["THEME"]["USE_DEBUG_GOALS"] === "Y") $.cookie("_ym_debug", 1, { path: "/" }); 7242 else $.cookie("_ym_debug", null, { path: "/" }); 7243 7244 /* change type2 menu for fixed */ 7245 if ($("#headerfixed .js-nav").length) { 7246 setTimeout(function () { 7247 $("#headerfixed .js-nav").addClass("opacity1"); 7248 }, 350); 7249 } 7250 7251 // -- scroll after apply option 7252 if ($(".instagram_ajax").length) { 7253 BX.addCustomEvent("onCompleteAction", function (eventdata) { 7254 if (eventdata.action === "instagrammLoaded") scrollPreviewBlock(); 7255 }); 7256 } else scrollPreviewBlock(); 7257 7258 scrollToTop(); 7259 checkVerticalMobileFilter(); 7260 7261 $("[data-scroll-block]").click(function () { 7262 var _this = $(this); 7263 if (_this.data("scrollBlock")) { 7264 var target = $(_this.data("scrollBlock")); 7265 if (target.length) { 7266 scroll_block(target); 7267 } 7268 } 7269 }); 7270 7271 // init calculate delivery with preview 7272 initCalculatePreview(); 7273 7274 // fix calendar popup zIndex 7275 BX.addCustomEvent("onPopupShow", function (popup) { 7276 if ( 7277 typeof popup !== "undefined" && 7278 popup && 7279 popup.zIndexComponent && 7280 popup.popupContainer && 7281 popup.popupContainer.querySelector(".bx-calendar") 7282 ) { 7283 popup.zIndexComponent.setZIndex(3000); 7284 } 7285 }); 7286 7287 /* city */ 7288 $("select.region").on("change", function () { 7289 var val = parseInt($(this).val()); 7290 if ($("select.city").length) { 7291 if (val) { 7292 $("select.city option").hide(); 7293 $("select.city option").prop("disabled", "disabled"); 7294 $("select.city option[data-parent_section=" + val + "]").prop("disabled", ""); 7295 $("select.city option:eq(0)").prop("disabled", ""); 7296 $("select.city").ikSelect("reset"); 7297 $("select.city option[data-parent_section=" + val + "]").show(); 7298 } else $("select.city option").prop("disabled", "disabled"); 7299 $("select.city option:eq(0)").prop("disabled", ""); 7300 $("select.city").ikSelect("reset"); 7301 } 7302 }); 7303 7304 $("select.city, select.region").on("change", function () { 7305 var _this = $(this), 7306 val = parseInt(_this.val()); 7307 if (_this.hasClass("region")) { 7308 $("select.city option:eq(0)").show(); 7309 $("select.city").val(0); 7310 } 7311 7312 if ((_this.hasClass("region") && !val) || _this.hasClass("city")) { 7313 $.ajax({ 7314 type: "POST", 7315 data: { ID: val }, 7316 success: function (html) { 7317 var ob = BX.processHTML(html); 7318 $(".ajax_items")[0].innerHTML = ob.HTML; 7319 BX.ajax.processScripts(ob.SCRIPT); 7320 }, 7321 }); 7322 } 7323 }); 7324 7325 $(document).on("mouseenter", ".section-gallery-wrapper .section-gallery-wrapper__item", function () { 7326 $(this).siblings().removeClass("_active"); 7327 $(this).addClass("_active"); 7328 }); 7329 7330 $(document).on("mouseleave", ".image_wrapper_block", function () { 7331 const $elements = $(this).find(".section-gallery-wrapper .section-gallery-wrapper__item"); 7332 if ($elements.length) { 7333 $elements.removeClass("_active"); 7334 $($elements[0]).addClass("_active"); 7335 } 7336 }); 7337 7338 $(document).on("click", ".hint .icon", function (e) {
7339 var tooltipWrapp = $(this).closest(".hint"); 7340 7341 if (tooltipWrapp.hasClass("active")) { 7342 tooltipWrapp.removeClass("active").find(".tooltip").slideUp(200); 7343 } else { 7344 tooltipWrapp.addClass("active"); 7345 tooltipWrapp.find(".tooltip").slideDown(200); 7346 tooltipWrapp.find(".tooltip_close").click(function (e) { 7347 e.stopPropagation(); 7348 tooltipWrapp.removeClass("active").find(".tooltip").slideUp(100); 7349 }); 7350 } 7351 e.stopPropagation(); 7352 }); 7353 7354 /* toggle */ 7355 var $this = this, 7356 previewParClosedHeight = 25; 7357 7358 $("section.toggle > label").prepend($("<i />").addClass("fa fa-plus")); 7359 $("section.toggle > label").prepend($("<i />").addClass("fa fa-minus")); 7360 $("section.toggle.active > p").addClass("preview-active"); 7361 $("section.toggle.active > div.toggle-content").slideDown(350, function () {}); 7362 7363 $("section.toggle > label").click(function (e) { 7364 var parentSection = $(this).parent(), 7365 parentWrapper = $(this).parents("div.toogle"), 7366 previewPar = false, 7367 isAccordion = parentWrapper.hasClass("toogle-accordion"); 7368 7369 if (isAccordion && typeof e.originalEvent != "undefined") { 7370 parentWrapper.find("section.toggle.active > label").trigger("click"); 7371 } 7372 7373 parentSection.toggleClass("active"); 7374 7375 // Preview Paragraph 7376 if (parentSection.find("> p").get(0)) { 7377 previewPar = parentSection.find("> p"); 7378 var previewParCurrentHeight = previewPar.css("height"); 7379 previewPar.css("height", "auto"); 7380 var previewParAnimateHeight = previewPar.css("height"); 7381 previewPar.css("height", previewParCurrentHeight); 7382 } 7383 7384 // Content 7385 var toggleContent = parentSection.find("> div.toggle-content"); 7386 7387 if (parentSection.hasClass("active")) { 7388 $(previewPar).animate( 7389 { 7390 height: previewParAnimateHeight, 7391 }, 7392 350, 7393 function () { 7394 $(this).addClass("preview-active"); 7395 } 7396 ); 7397 toggleContent.slideDown(350, function () {}); 7398 } else { 7399 $(previewPar).animate( 7400 { 7401 height: previewParClosedHeight, 7402 }, 7403 350, 7404 function () { 7405 $(this).removeClass("preview-active"); 7406 } 7407 ); 7408 toggleContent.slideUp(350, function () {}); 7409 } 7410 }); 7411 7412 if (typeof $.fn.footable == "function") { 7413 $(".tables-responsive .responsive").footable(); //responsive table 7414 } 7415 7416 $("a[rel=tooltip]").tooltip(); 7417 $("span[data-toggle=tooltip]").tooltip(); 7418 7419 $(document).on("click", ".toggle .more_items", function () { 7420 $(this).closest(".toggle").find(".collapsed").removeClass("collapsed"); 7421 $(this).remove(); 7422 if (typeof $(this).data("resize") !== "undefined" && $(this).data("resize")) $(window).resize(); 7423 }); 7424 $(document).on("click", ".toggle_menu .more_items", function () { 7425 $(this).closest(".toggle_menu").find(".collapsed").addClass("clicked_exp"); 7426 $(this).remove(); 7427 }); 7428 7429 /* search sync */ 7430 $(document).on("keyup", ".search-input-div input", function (e) { 7431 var inputValue = $(this).val(); 7432 $(".search-input-div input:not(:focus").val(inputValue); 7433 7434 if ($(this).closest("#headerfixed").length) { 7435 if (e.keyCode == 13) $(".search form").submit(); 7436 } 7437 }); 7438 $(document).on("click", ".search-button-div button", function (e) { 7439 if ($(this).closest("#headerfixed").length) $(".search form").submit(); 7440 }); 7441 7442 $(".inline-search-show, .inline-search-hide").on("click", function (e) { 7443 CloseMobilePhone(); 7444 // Closing hint list of items after search input loses focus 7445 if (e.target.closest(".inline-search-hide")) { 7446 if (typeof jsControl === "object" && jsControl && "onFocusLost" in jsControl) { 7447 jsControl.onFocusLost(); 7448 } 7449 } 7450 if (typeof $(this).data("type_search") != "undefined" && $(this).data("type_search") == "fixed") 7451 $(".inline-search-block").addClass("fixed"); 7452 7453 if (arAsproOptions["THEME"]["TYPE_SEARCH"] == "fixed") { 7454 $(".inline-search-block.fixed.big .search-input").focus(); 7455 } 7456 if (arAsproOptions["THEME"]["TYPE_SEARCH"] != "fixed") { 7457 $("#title-search-input").focus(); 7458 } 7459 7460 $(".inline-search-block").toggleClass("show"); 7461 if ($(".top-block").length) { 7462 if ($(".inline-search-block").hasClass("show")) 7463 $(".inline-search-block").css("background", $(".top-block").css("background-color")); 7464 else $(".inline-search-block").css("background", "#fff"); 7465 } 7466 if (arAsproOptions["THEME"]["TYPE_SEARCH"] == "fixed") {
7467 if ($(".inline-search-block").hasClass("show")) $('<div class="jqmOverlay search"></div>').appendTo("body"); 7468 else { 7469 $("#title-search-input").blur(); 7470 $(".jqmOverlay").detach(); 7471 } 7472 } 7473 // } 7474 // else 7475 // location.href = arAsproOptions['PAGES']['CATALOG_PAGE_URL']+'?q'; 7476 }); 7477 7478 /* close search block */ 7479 $("html, body").on("mousedown", function (e) { 7480 if (typeof e.target.className == "string" && e.target.className.indexOf("adm") < 0) { 7481 e.stopPropagation(); 7482 var search_target = $(e.target).closest(".title-search-result"); 7483 if ( 7484 !$(e.target).closest(".inline-search-block").length && 7485 !$(e.target).closest(".dropdown-select.searchtype").length && 7486 !$(e.target).hasClass("svg") && 7487 !search_target.length 7488 ) { 7489 $(".inline-search-block").removeClass("show"); 7490 $(".title-search-result").hide(); 7491 if (arAsproOptions["THEME"]["TYPE_SEARCH"] == "fixed") $(".jqmOverlay.search").detach(); 7492 } 7493 7494 if ($("#mobilePhone").length) { 7495 CloseMobilePhone(); 7496 } 7497 7498 if ($("#basket_line .basket_fly").length && parseInt($("#basket_line .basket_fly").css("right")) >= 0) { 7499 if (!$(e.target).closest(".basket_wrapp").length) { 7500 $("#basket_line .basket_fly") 7501 .stop() 7502 .animate( 7503 { 7504 right: -$("#basket_line .basket_fly").outerWidth(), 7505 }, 7506 150 7507 ); 7508 $("#basket_line .basket_fly .opener > div").removeClass("cur"); 7509 $("#basket_line .basket_fly").removeClass("swiped"); 7510 } 7511 } 7512 7513 if (isMobile) { 7514 if (search_target.length) location.href = search_target.attr("href"); 7515 } 7516 7517 if (!$(e.target).closest(".js-info-block").length && !$(e.target).closest(".js-show-info-block").length) { 7518 $(".js-show-info-block").removeClass("opened"); 7519 $(".js-info-block").fadeOut(); 7520 } 7521 7522 if (!$(e.target).closest(".hint.active").length) { 7523 $(".hint.active .icon").trigger("click"); 7524 } 7525 7526 var class_name = $(e.target).attr("class"); 7527 if (typeof class_name == "undefined" || class_name.indexOf("tooltip") < 0) 7528 //tooltip link 7529 $(".tooltip-link").tooltip("hide"); 7530 } 7531 }); 7532 7533 initAnimateLoad(); 7534 7535 /* check all opt table items */ 7536 $(document).on("change", "input#select_all_items", function () { 7537 var _this = $(this); 7538 var notOfferCount = 0; 7539 var bComplect = _this.closest(".complect_main_wrap").length; 7540 if (bComplect) { 7541 notOfferCount = _this 7542 .closest(".complect_main_wrap") 7543 .find(".catalog-block-view__item .counter_wrapp:not(.ce_cmp_visible) .button_block .to-cart").length; 7544 } else { 7545 notOfferCount = $( 7546 ".table-view__item:not([data-product_type=3]), .table-view-offer-tree .table-view__item[data-product_type=3] .counter_wrapp:not(.ce_cmp_visible)" 7547 ).find(".button_block .to-cart").length; 7548 } 7549 var wishCount = $( 7550 ".table-view__item:not([data-product_type=3]), .table-view-offer-tree .table-view__item[data-product_type=3]" 7551 ).find(".item-icons .wish_item_button .wish_item.to").length; 7552 var allGoodsCount = $(".table-view__item").length; 7553 7554 if (_this.is(":checked")) { 7555 //buy && wish 7556 if (notOfferCount != 0) { 7557 $(".opt_action:not([data-action=compare])").removeClass("no-action"); 7558 } 7559 7560 //compare 7561 $(".opt_action[data-action=compare]").removeClass("no-action"); 7562 7563 $(".opt_action").addClass("animate-load"); 7564 $(".opt_action .text").remove(); 7565 7566 //buy 7567 $('<div class="text">(<span>' + notOfferCount + "</span>)</div>").appendTo($(".opt_action[data-action=buy]")); 7568 7569 //wish 7570 $('<div class="text muted">(<span>' + wishCount + "</span>)</div>").appendTo($(".opt_action[data-action=wish]")); 7571 7572 //compare 7573 $('<div class="text muted">(<span>' + allGoodsCount + "</span>)</div>").appendTo( 7574 $(".opt_action[data-action=compare]") 7575 ); 7576 7577 $('input[name="chec_item"]').prop("checked", true); 7578 } else { 7579 $(".opt_action").addClass("no-action"); 7580 $(".opt_action").removeClass("animate-load"); 7581 $(".opt_action .text").remove(); 7582 7583 $('input[name="chec_item"]').prop("checked", false); 7584 } 7585 7586 if (_this.closest(".complect_header_block").length && typeof setNewPriceComplect === "function") { 7587 setNewPriceComplect(); 7588 } 7589 }); 7590 7591 /* check opt table item */ 7592 $(document).on("change", "input[name='chec_item']", function () { 7593 var _this = $(this); 7594 7595 var canBuy = 7596 _this.closest(".table-view__item").find(".button_block .to-cart").length || 7597 _this.closest(".catalog-block-view__item").find(".button_block .to-cart").length; 7598 var isOffer = _this.closest(".main_item_wrapper").attr("data-product_type") == "3" && !canBuy; 7599 7600 if (_this.is(":checked")) { 7601 $(".opt_action").each(function () { 7602 var _this = $(this); 7603 7604 var isBuyAction = _this.attr("data-action") == "buy"; 7605 var isFavoriteAction = _this.attr("data-action") == "favorite"; 7606 7607 if (isOffer && (isBuyAction || isFavoriteAction)) { 7608 return true; 7609 } 7610 7611 if (isBuyAction && !canBuy) { 7612 return true; 7613 } 7614 7615 if (_this.find(".text").length) { 7616 var count = parseInt(_this.find(".text span").text()); 7617 _this.find(".text span").text(++count); 7618 } else { 7619 _this.removeClass("no-action"); 7620 _this.addClass("animate-load"); 7621 $('<div class="text muted">(<span>1</span>)</div>').appendTo(_this); 7622 } 7623 }); 7624 } else { 7625 $(".opt_action").each(function () { 7626 var _this = $(this); 7627 7628 var isBuyAction = _this.attr("data-action") == "buy"; 7629 var isFavoriteAction = _this.attr("data-action") == "favorite"; 7630 7631 if (isOffer && (isBuyAction || isFavoriteAction)) { 7632 return true; 7633 } 7634 7635 if (isBuyAction && !canBuy) { 7636 return true; 7637 } 7638 7639 if (_this.find(".text").length) { 7640 var count = parseInt(_this.find(".text span").text()); 7641 --count; 7642 _this.find(".text span").text(count); 7643 7644 if (!count) { 7645 _this.addClass("no-action"); 7646 _this.removeClass("animate-load"); 7647 _this.find(".text").remove(); 7648 } 7649 } 7650 }); 7651 } 7652 }); 7653 7654 /* buy|wish|compare opt table items */ 7655 $(document).on("click", ".opt_action", function (event) { 7656 var _this = $(this), 7657 action = _this.data("action"), 7658 itemsAll = [], 7659 basketParams = { 7660 type: "multiple", 7661 iblock_id: _this.data("iblock_id"), 7662 action: action, 7663 items: {}, 7664 }; 7665 7666 if (!_this.hasClass("no-action")) { 7667 $(".opt_action").addClass("no-action"); 7668 _this.removeClass("no-action"); 7669 7670 $(".table-view__item, .catalog-block-view__item").each(function () { 7671 var _this = $(this); 7672 var canBuy = _this.find(".button_block .to-cart").length; 7673 var add = _this.find('input[name="chec_item"]').is(":checked") && (canBuy || action != "buy"); 7674 var addOffer = _this.data("product_type") == "3" && _this.find(".button_block .to-cart").length; 7675 if (add) { 7676 var itemId = addOffer ? _this.find(".button_block .to-cart").data("item") : _this.data("id"); 7677 itemsAll.push(_this[0]); 7678 basketParams["items"][itemId] = {}; 7679 basketParams["items"][itemId]["id"] = itemId; 7680 basketParams["items"][itemId]["product_type"] = _this.data("product_type"); 7681 basketParams["items"][itemId]["quantity"] = _this.find('input[name="quantity"]').val(); 7682 if (addOffer) { 7683 basketParams["items"][itemId]["add_offer"] = "Y"; 7684 } 7685 } 7686 }); 7687 7688 if (basketParams.action !== "buy") { 7689 let itemAction = JItemAction.factory(this, { 7690 bindEvents: false, 7691 changeState: false, 7692 fireGoals: false, 7693 }); 7694 itemAction.data = basketParams; 7695 itemAction.onCompleteEvent = () => { 7696 itemAction.showNotice(itemsAll); 7697 itemAction.finalAction(); 7698 }; 7699 7700 itemAction.fireEvent(event); 7701 7702 $(".opt_action").removeClass("no-action"); 7703 7704 return; 7705 } 7706 7707 $.ajax({ 7708 type: "POST", 7709 url: arAsproOptions["SITE_DIR"] + "ajax/item.php", 7710 data: basketParams, 7711 dataType: "json", 7712 success: function (data) { 7713 if ("STATUS" in data) { 7714 if (data.STATUS !== "OK") { 7715 showBasketError(BX.message(data.MESSAGE) + " <br/>" + data.MESSAGE_EXT); 7716 } 7717 7718 //js notice
7719 if (typeof JNoticeSurface !== "undefined") { 7720 switch (action) { 7721 case "buy": 7722 JNoticeSurface.get().onAdd2cart(itemsAll); 7723 break; 7724 default: 7725 console.log("nothing"); 7726 } 7727 } 7728 // 7729 7730 if ($(".header-cart.fly").length) { 7731 arBasketAsproCounters.DEFAULT = true; 7732 SetActualBasketFlyCounters(true); 7733 } else { 7734 if ($("#ajax_basket").length) { 7735 reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "N", "", true); 7736 } else { 7737 reloadBasketCounters("", true); 7738 } 7739 } 7740 } 7741 _this.parent().removeClass("loadings"); 7742 $(".opt_action").removeClass("no-action"); 7743 }, 7744 }); 7745 } 7746 }); 7747 7748 //fix opt checked for back in browser 7749 setTimeout(function () { 7750 if ($('.with-opt-buy input[name="chec_item"], .with-opt-buy input[name="select_all_items"]').length) { 7751 $('.with-opt-buy input[name="chec_item"], .with-opt-buy input[name="select_all_items"]').prop("checked", false); 7752 } 7753 }, 1); 7754 7755 $(document).on("click", '*[data-event="jqm"]', function (e) { 7756 e.preventDefault(); 7757 e.stopPropagation(); 7758 7759 var _this = $(this); 7760 var name = _this.data("name"); 7761 if (previewMode && ((name.length && name == "auth") || window.matchMedia("(max-width:400px)").matches)) { 7762 var script = arAsproOptions["SITE_DIR"] + "form/"; 7763 var paramsStr = ""; 7764 $.each(_this.get(0).attributes, function (index, attr) { 7765 var attrName = attr.nodeName; 7766 var attrValue = _this.attr(attrName);
7767 if (/^data\-param\-(.+)$/.test(attrName)) { 7768 var key = attrName.match(/^data\-param\-(.+)$/)[1]; 7769 paramsStr += key + "=" + attrValue + "&"; 7770 } 7771 }); 7772 7773 script += "?name=" + name + "&" + paramsStr; 7774 7775 if (_this.attr("href") !== undefined) { 7776 script = _this.attr("href"); 7777 } 7778 7779 location.href = script; 7780 } else { 7781 if (!$(this).hasClass("clicked")) { 7782 $(this).addClass("clicked"); 7783 $(this).jqmEx(); 7784 // $(this).trigger("click"); 7785 } 7786 } 7787 7788 return false; 7789 }); 7790 // } 7791 7792 BX.addCustomEvent("onCompleteAction", function (eventdata, _this) { 7793 try { 7794 if (eventdata.action === "loadForm") { 7795 $(_this).parent().removeClass("loadings"); 7796 $(_this).removeClass("clicked"); 7797 7798 if ($(_this).hasClass("one_click_buy_trigger")) { 7799 $(".wrapp_one_click > span").removeClass("clicked"); 7800 $(".one_click").removeClass("clicked"); 7801 } else if ($(_this).hasClass("one_click_buy_basket_trigger")) { 7802 $(".fast_order").removeClass("clicked"); 7803 } 7804 } else if (eventdata.action === "loadBasket") { 7805 $(".basket-link.basket").attr("title", $("<div/>").html(arBasketPrices.BASKET_SUMM_TITLE).text()); 7806 7807 if (arBasketPrices.BASKET_COUNT > 0) { 7808 $(".basket-link.basket").addClass("basket-count"); 7809 $(".basket-link.basket .count").removeClass("empted"); 7810 if ($(".basket-link.basket .prices").length) 7811 $(".basket-link.basket .prices").html(arBasketPrices.BASKET_SUMM); 7812 } else { 7813 $(".basket-link.basket").removeClass("basket-count"); 7814 $(".basket-link.basket .count").addClass("empted"); 7815 if ($(".basket-link.basket .prices").length) 7816 $(".basket-link.basket .prices").html(arBasketPrices.BASKET_SUMM_TITLE_SMALL); 7817 } 7818 $(".basket-link.basket .count").text(arBasketPrices.BASKET_COUNT); 7819 7820 updateBottomIconsPanel(arBasketPrices); 7821 } else if (eventdata.action === "loadRSS") { 7822 } else if (eventdata.action === "ajaxContentLoaded") { 7823 } else if (eventdata.action === "jsLoadBlock") { 7824 // initCountdown(); 7825 setStatusButton(); 7826 setTimeout(function () { 7827 InitOwlSlider(); 7828 }, 200); 7829 if (typeof initSwiperSlider === "function") { 7830 initSwiperSlider(); 7831 } 7832 InitFancyBox(); 7833 7834 checkLinkedArticles(); 7835 checkLinkedBlocks(".linked-banners-list"); 7836 lazyLoadPagenBlock(); 7837 7838 if (typeof window["stickySidebar"] !== "undefined") { 7839 window["stickySidebar"].updateSticky(); 7840 } 7841 } 7842 } catch (e) { 7843 console.error(e); 7844 } 7845 }); 7846 7847 /* slices */ 7848 if ($(".banners-small .item.normal-block").length) $(".banners-small .item.normal-block").sliceHeight(); 7849 if ($(".teasers .item").length) $(".teasers .item").sliceHeight(); 7850 if ($(".wrap-portfolio-front .row.items > div").length) 7851 $(".wrap-portfolio-front .row.items > div").sliceHeight({ 7852 row: ".row.items", 7853 item: ".item1", 7854 }); 7855 7856 /* bug fix in ff */ 7857 $("img").removeAttr("draggable"); 7858 7859 $(".title-tab-heading").on("click", function () { 7860 var container = $(this).parent(), 7861 slide_block = $(this).next(), 7862 bReviewTab = container.hasClass("media_review"); 7863 7864 clicked_tab = container.index() + 1; 7865 7866 container.siblings().removeClass("active"); 7867 7868 $(".nav.nav-tabs li").removeClass("active"); 7869 7870 if (container.hasClass("active")) { 7871 if (bReviewTab) { 7872 $("#reviews_content").slideUp(200, function () { 7873 container.removeClass("active"); 7874 }); 7875 } else { 7876 slide_block.slideUp(200, function () { 7877 container.removeClass("active"); 7878 }); 7879 } 7880 } else { 7881 container.addClass("active"); 7882 if (bReviewTab) { 7883 $("#reviews_content").slideDown(); 7884 } else { 7885 if ($(".tabs_section + #reviews_content").length) $(".tabs_section + #reviews_content").slideUp(); 7886 slide_block.slideDown(); 7887 if (typeof container.attr("id") !== "undefined" && container.attr("id") == "de
7887scr") { 7888 var $gallery = $(".galerys-block"); 7889 if ($gallery.length) { 7890 var bTypeBig = $gallery.find(".big_slider").length; 7891 var $slider = bTypeBig ? $gallery.find(".big_slider") : $gallery.find(".small_slider"); 7892 var interval = setInterval(function () { 7893 if ($slider.find(".slides .item").attr("style").indexOf("height") === -1) { 7894 $(window).resize(); 7895 } else { 7896 clearInterval(interval); 7897 } 7898 }, 100); 7899 } 7900 } 7901 } 7902 } 7903 }); 7904 7905 InitOwlSlider(); 7906 InitStickySideBar(); 7907 InitFancyBox(); 7908 InitFancyBoxVideo(); 7909 7910 setTimeout(function () { 7911 InitTopestMenuGummi(); 7912 isOnceInited = true; 7913 $(".menu.topest").closest(".dotted-flex-1").addClass("dotted-complete"); 7914 }, 50); 7915 7916 InitZoomPict(); 7917 7918 /* show print */ 7919 if (arAsproOptions["PAGES"]["BASKET_PAGE"]) { 7920 showBasketHeadingBtn(); 7921 } else { 7922 if (arAsproOptions["THEME"]["PRINT_BUTTON"] === "Y") { 7923 setTimeout(function () { 7924 var topicHeading = document.querySelector(".period_wrapper.in-detail-news1 .period_wrapper_inner") 7925 ? document.querySelector(".detail-news1 .period_wrapper .period_wrapper_inner") 7926 : document.querySelector(".page-top .topic .topic__heading") 7927 ? document.querySelector(".page-top .topic .topic__heading") 7928 : null; 7929 if (topicHeading) { 7930 var btnPrint = BX.create({ 7931 tag: "div", 7932 attrs: { 7933 class: "print-link colored_theme_hover_bg-block", 7934 title: arAsproOptions["THEME"]["EXPRESSION_FOR_PRINT_PAGE"], 7935 }, 7936 html: '<i class="svg colored_theme_hover_bg-el-svg"><svg class="svg svg-print" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path id="Rectangle_665_copy_4" data-name="Rectangle 665 copy 4" class="cls-print" d="M1570,210h-2v3h-8v-3h-2a2,2,0,0,1-2-2v-5a2,2,0,0,1,2-2h2v-4h8v4h2a2,2,0,0,1,2,2v5A2,2,0,0,1,1570,210Zm-8,1h4v-4h-4v4Zm4-12h-4v2h4v-2Zm4,4h-12v5h2v-3h8v3h2v-5Z" transform="translate(-1556 -197)"></path></svg></i>', 7937 }); 7938 BX.insertBefore(btnPrint, topicHeading); 7939 } 7940 }, 150); 7941 } 7942 } 7943 7944 $(document).on("click", ".print-link", function () { 7945 window.print(); 7946 }); 7947 7948 $(".head-block .item-link").on("click", function () { 7949 var _this = $(this); 7950 _this.siblings().removeClass("active"); 7951 _this.addClass("active"); 7952 }); 7953 7954 $("table.table").each(function () { 7955 var _this = $(this), 7956 first_td = _this.find("thead tr th"); 7957 if (!first_td.length) first_td = _this.find("thead tr td"); 7958 if (first_td.length) { 7959 var j = 0; 7960 _this.find("tbody tr td").each(function (i) { 7961 if (j > first_td.length - 1) j = 0; 7962 $('<div class="th-mobile">' + first_td[j].textContent + "</div>").appendTo($(this)); 7963 j++; 7964 }); 7965 } 7966 }); 7967 7968 if (window.matchMedia("(min-width: 768px)").matches) $(".wrapper_middle_menu.wrap_menu").removeClass("mobile"); 7969 7970 if (window.matchMedia("(max-width: 767px)").matches) $(".wrapper_middle_menu.wrap_menu").addClass("mobile"); 7971 7972 $(document).on("click", ".menu_top_block .v_bottom a", function (e) { 7973 if ($(e.target).hasClass("toggle_block")) e.preventDefault(); 7974 }); 7975 $(document).on("click", ".menu_top_block .v_bottom a .toggle_block", function (e) { 7976 var _this = $(this), 7977 menu = _this.closest(".has-child").find("> .dropdown"), 7978 bVisibleMeu = menu.is(":visible"), 7979 animate = bVisibleMeu ? "slideUp" : "slideDown"; 7980 7981 if (!_this.hasClass("clicked")) { 7982 _this.addClass("clicked"); 7983 7984 menu.stop().slideToggle({ 7985 duration: 150, 7986 start: function () { 7987 _this.toggleClass("closed"); 7988 }, 7989 complete: function () { 7990 _this.removeClass("clicked"); 7991 7992 if (typeof window["stickySidebar"] !== "undefined") { 7993 window["stickySidebar"].updateSticky(); 7994 } 7995 }, 7996 }); 7997 } 7998 7999 $(this).closest(".has-child").toggleClass("opened"); 8000 }); 8001 8002 $(document).on("click", ".show_props", function () { 8003 $(this).prev().stop().slideToggle(333); 8004 $(this).find(".char_title").toggleClass("opened"); 8005 }); 8006 8007 $(".see_more").on("click", function (e) { 8008 e.preventDefault(); 8009 var see_more = $(this).is(".see_more") ? $(this) : $(this).parents(".see_more").first(); 8010 var see_moreText = see_more.find("> a").length ? see_more.find("> a") : see_more; 8011 var see_moreHiden = see_more.parent().find("> .d"); 8012 if (see_more.hasClass("open")) { 8013 see_moreText.text(BX.message("CATALOG_VIEW_MORE")); 8014 see_more.removeClass("open"); 8015 see_moreHiden.hide(); 8016 } else { 8017 see_moreText.text(BX.message("CATALOG_VIEW_LESS")); 8018 see_more.addClass("open"); 8019 see_moreHiden.show(); 8020 } 8021 return false;
8022 }); 8023 8024 $(".button.faq_button").click(function (e) { 8025 e.preventDefault(); 8026 $(this).toggleClass("opened"); 8027 $(".faq_ask .form").slideToggle(); 8028 }); 8029 8030 $(".staff.list .staff_section .staff_section_title a").click(function (e) { 8031 e.preventDefault(); 8032 $(this).parents(".staff_section").toggleClass("opened"); 8033 $(this).parents(".staff_section").find(".staff_section_items").stop().slideToggle(600); 8034 $(this).parents(".staff_section_title").find(".opener_icon").toggleClass("opened"); 8035 }); 8036 8037 $(".jobs_wrapp .item .name").click(function (e) { 8038 $(this).closest(".item").toggleClass("opened"); 8039 $(this).closest(".item").find(".description_wrapp").stop().slideToggle(600); 8040 $(this).closest(".item").find(".opener_icon").toggleClass("opened"); 8041 }); 8042 8043 $(".faq.list .item .q a").on("click", function (e) { 8044 e.preventDefault(); 8045 $(this).parents(".item").toggleClass("opened"); 8046 $(this).parents(".item").find(".a").stop().slideToggle(); 8047 $(this).parents(".item").find(".q .opener_icon").toggleClass("opened"); 8048 }); 8049 8050 $(".opener_icon").click(function (e) { 8051 e.preventDefault(); 8052 $(this).parent().find("a").trigger("click"); 8053 }); 8054 8055 $(".more_block span").on("click", function () { 8056 var content_offset = $(".catalog_detail .tabs_section").offset(); 8057 $("html, body").animate({ scrollTop: content_offset.top - 43 }, 400); 8058 }); 8059 8060 $(document).on("click", ".counter_block:not(.basket) .plus", function () { 8061 if (!$(this).parents(".basket_wrapp").length || $(this).parents(".services_in_basket").length) { 8062 if ($(this).parent().data("offers") != "Y") { 8063 var isDetailSKU2 = $(this).parents(".counter_block_wr").length; 8064 input = $(this).parents(".counter_block").find("input[type=text]"); 8065 (tmp_ratio = !isDetailSKU2 8066 ? $(this).parents(".counter_wrapp").find(".to-cart").data("ratio") 8067 : $(this).parents("tr").first().find("td.buy .to-cart").data("ratio")), 8068 (isDblQuantity = !isDetailSKU2 8069 ? $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio") 8070 : $(this).parents("tr").first().find("td.buy .to-cart").data("float_ratio")), 8071 (ratio = isDblQuantity ? parseFloat(tmp_ratio) : parseInt(tmp_ratio, 10)), 8072 (max_value = ""); 8073 currentValue = input.val(); 8074 8075 if (isDblQuantity) 8076 ratio = 8077 Math.round(ratio * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / 8078 arAsproOptions.JS_ITEM_CLICK.precisionFactor; 8079 8080 curValue = isDblQuantity ? parseFloat(currentValue) : parseInt(currentValue, 10); 8081 8082 curValue += ratio; 8083 if (isDblQuantity) { 8084 curValue = 8085 Math.round(curValue * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / 8086 arAsproOptions.JS_ITEM_CLICK.precisionFactor; 8087 } 8088 8089 if (parseFloat($(this).data("max")) > 0) { 8090 if (input.val() < $(this).data("max")) { 8091 if (curValue <= $(this).data("max")) input.val(curValue); 8092 8093 input.change(); 8094 } 8095 } else { 8096 input.val(curValue); 8097 input.change(); 8098 } 8099 } 8100 } 8101 }); 8102 $(document).on("click", ".counter_block:not(.basket) .minus", function () { 8103 if (!$(this).parents(".basket_wrapp").length || $(this).parents(".services_in_basket").length) { 8104 if ($(this).parent().data("offers") != "Y") { 8105 var isDetailSKU2 = $(this).parents(".counter_block_wr").length; 8106 input = $(this).parents(".counter_block").find("input[type=text]"); 8107 (tmp_ratio = !isDetailSKU2 8108 ? $(this).parents(".counter_wrapp").find(".to-cart").data("ratio") 8109 : $(this).parents("tr").first().find("td.buy .to-cart").data("ratio")), 8110 (isDblQuantity = !isDetailSKU2 8111 ? $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio") 8112 : $(this).parents("tr").first().find("td.buy .to-cart").data("float_ratio")), 8113 (ratio = isDblQuantity ? parseFloat(tmp_ratio) : parseInt(tmp_ratio, 10)), 8114 (max_value = ""); 8115 currentValue = input.val(); 8116 8117 if (isDblQuantity) 8118 ratio = 8119 Math.round(ratio * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / 8120 arAsproOptions.JS_ITEM_CLICK.precisionFactor; 8121 8122 curValue = isDblQuantity ? parseFloat(currentValue) : parseInt(currentValue, 10); 8123 8124 curValue -= ratio; 8125 if (isDblQuantity) { 8126 curValue = 8127 Math.round(curValue * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / 8128 arAsproOptions.JS_ITEM_CLICK.precisionFactor; 8129 } 8130 const minValue = parseFloat($(this).parents(".counter_block").find(".minus").data("min")); 8131 if (minValue) { 8132 ratio = minValue; 8133 } 8134 8135 if (parseFloat($(this).parents(".counter_block").find(".plus").data("max")) > 0) { 8136 if (currentValue > ratio) { 8137 if (curValue < ratio) { 8138 input.val(ratio); 8139 } else { 8140 input.val(curValue); 8141 } 8142 input.change(); 8143 } 8144 } else { 8145 if (curValue > ratio) { 8146 input.val(curValue); 8147 } else { 8148 if (ratio) { 8149 input.val(ratio); 8150 } else if (currentValue > 1) { 8151 input.val(curValue); 8152 } 8153 } 8154 input.change(); 8155 } 8156 } 8157 } 8158 }); 8159 8160 $(".counter_block input[type=text]").numeric({ allow: "." }); 8161 8162 $(document).on("focus", ".counter_block input[type=text]", function (e) { 8163 $(this).addClass("focus"); 8164 }); 8165 8166 $(document).on("blur", ".counter_block input[type=text]", function (e) { 8167 $(this).removeClass("focus"); 8168 }); 8169 8170 var timerInitCalculateDelivery = false;
8171 $(document).on("change", ".counter_block input[type=text]", function (e) { 8172 if (!$(this).parents(".basket_wrapp").length) { 8173 var val = $(this).val(), 8174 tmp_ratio = $(this).parents(".counter_wrapp").find(".to-cart").data("ratio") 8175 ? $(this).parents(".counter_wrapp").find(".to-cart").data("ratio") 8176 : $(this).parents("tr").first().find("td.buy .to-cart").data("ratio"), 8177 isDblQuantity = $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio") 8178 ? $(this).parents(".counter_wrapp").find(".to-cart").data("float_ratio") 8179 : $(this).parents("tr").first().find("td.buy .to-cart").data("float_ratio"), 8180 ratio = isDblQuantity ? parseFloat(tmp_ratio) : parseInt(tmp_ratio, 10), 8181 diff = val % ratio; 8182 8183 if (isDblQuantity) { 8184 ratio = 8185 Math.round(ratio * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / 8186 arAsproOptions.JS_ITEM_CLICK.precisionFactor; 8187 if ( 8188 Math.round(diff * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / 8189 arAsproOptions.JS_ITEM_CLICK.precisionFactor == 8190 ratio 8191 ) 8192 diff = 0; 8193 } 8194 8195 if ($(this).hasClass("focus")) { 8196 intCount = 8197 Math.round( 8198 Math.round((val * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / ratio) / 8199 arAsproOptions.JS_ITEM_CLICK.precisionFactor 8200 ) || 1; 8201 val = intCount <= 1 ? ratio : intCount * ratio; 8202 // val -= diff; 8203 val = 8204 Math.round(val * arAsproOptions.JS_ITEM_CLICK.precisionFactor) / arAsproOptions.JS_ITEM_CLICK.precisionFactor; 8205 } 8206 8207 if (parseFloat($(this).parents(".counter_block").find(".plus").data("max")) > 0) { 8208 if (val > parseFloat($(this).parents(".counter_block").find(".plus").data("max"))) { 8209 val = parseFloat($(this).parents(".counter_block").find(".plus").data("max")); 8210 // val -= (val % ratio); 8211 } 8212 } 8213 if (parseFloat($(this).parents(".counter_block").find(".minus").data("min")) > 0) { 8214 if (val < parseFloat($(this).parents(".counter_block").find(".minus").data("min"))) { 8215 val = parseFloat($(this).parents(".counter_block").find(".minus").data("min")); 8216 // val -= (val % ratio); 8217 } 8218 } 8219 if (val < ratio) { 8220 val = ratio; 8221 } else if (!parseFloat(val)) { 8222 val = 1; 8223 } 8224 8225 $(this).parents(".counter_block").parent().parent().find(".to-cart").attr("data-quantity", val); 8226 $(this).parents(".counter_block").parent().parent().parent().find(".one_click").attr("data-quantity", val); 8227 $(this) 8228 .parents(".counter_block") 8229 .parent() 8230 .parent() 8231 .parent() 8232 .parent() 8233 .find(".one_click") 8234 .attr("data-quantity", val); //for offers in list 8235 $(this).parents(".catalog_item_wrapp").find(".inner_wrap.TYPE_1 .one_click").attr("data-quantity", val); //for first type buttons in catalog_block 8236 8237 $(this).val(val); 8238 8239 var $calculate = $(this).closest(".item").length 8240 ? $(this).closest(".item").find(".calculate-delivery") 8241 : $(this).closest(".catalog_detail").find(".calculate-delivery"); 8242 if ($calculate.length && !$(this).closest(".buy_services_wrap").length) { 8243 $calculate.each(function () { 8244 var $calculateSpan = $(this).find("span[data-event=jqm]").first(); 8245 8246 if ($calculateSpan.length) { 8247 var $clone = $calculateSpan.clone(); 8248 $clone.attr("data-param-quantity", val).removeClass("clicked"); 8249 $clone.insertAfter($calculateSpan).on("click", function () { 8250 if (!jQuery.browser.mobile) { 8251 $(this).parent().addClass("loadings"); 8252 } 8253 }); 8254 $calculateSpan.remove(); 8255 } 8256 8257 if ($(this).hasClass("with_preview")) { 8258 $(this).removeClass("inited"); 8259 8260 if (timerInitCalculateDelivery) { 8261 clearTimeout(timerInitCalculateDelivery); 8262 } 8263 8264 timerInitCalculateDelivery = setTimeout(function () { 8265 initCalculatePreview(true); 8266 timerInitCalculateDelivery = false;
8267 }, 1000); 8268 } 8269 }); 8270 } 8271 8272 var eventdata = { 8273 type: "change", 8274 params: { id: $(this), value: val }, 8275 }; 8276 BX.onCustomEvent("onCounterProductAction", [eventdata]); 8277 8278 if ($(this).closest(".complect-block").length && typeof setNewPriceComplect === "function") { 8279 setNewPriceComplect(); 8280 } 8281 } 8282 }); 8283 8284 BX.addCustomEvent("onCounterProductAction", function (eventdata) { 8285 if (typeof eventdata != "object") { 8286 eventdata = { type: "undefined" }; 8287 } 8288 try { 8289 if (typeof eventdata.type != "undefined") { 8290 if (!eventdata.params.id.closest(".gifts").length) { 8291 // no gift 8292 var obProduct = eventdata.params.id.data("product"); 8293 if (eventdata.params.id.closest(".has_offer_prop").length) { 8294 // type1 for offers in element list 8295 if (typeof window["obSkuQuantys"] === "undefined") window["obSkuQuantys"] = {}; 8296 8297 window["obSkuQuantys"][eventdata.params.id.closest(".offer_buy_block").find(".to-cart").data("item")] = 8298 eventdata.params.value; 8299 } 8300 8301 if (typeof window[obProduct] == "object") { 8302 if (obProduct == "offersTree") { 8303 let curOffer = eventdata.params.id.closest(".offer_buy_block").find(".to-cart").data("item"); 8304 if (curOffer && appAspro.sku.obOffers[curOffer]) { 8305 appAspro.sku.setPriceAction( 8306 appAspro.sku.obOffers[curOffer], 8307 "", 8308 "", 8309 appAspro.sku.obOffers[curOffer].item 8310 ); 8311 } 8312 } else window[obProduct].setPriceAction("Y"); 8313 if ($(".detail_page").length) { 8314 setNewHeader(); 8315 } 8316 } else if (eventdata.params.id.length) { 8317 if ( 8318 eventdata.params.id.closest(".main_item_wrapper").length && 8319 !eventdata.params.id.closest(".services-item__buy").length && 8320 arAsproOptions["THEME"]["SHOW_TOTAL_SUMM"] == "Y" 8321 ) { 8322 setPriceItem(eventdata.params.id.closest(".main_item_wrapper"), eventdata.params.value); 8323 } 8324 } 8325 BX.onCustomEvent("onCounterProductActionResize"); 8326 } 8327 } 8328 } catch (e) { 8329 console.error(e); 8330 } 8331 }); 8332 8333 /* show basket on hover */ 8334 $(document).on("mouseenter", ".wrap_icon.top_basket, #headerfixed .basket-link.basket", function () { 8335 const _this = $(this); 8336 const isHeaderFixed = _this.closest("#headerfixed").length; 8337 const hover_block = isHeaderFixed ? _this.next(".basket_hover_block") : _this.find(".basket_hover_block"); 8338 8339 if (!hover_block.hasClass("loaded")) { 8340 basketTop("", hover_block); 8341 } 8342 }); 8343 8344 /* show basket on click mobile */ 8345 $(document).on("click", ".wrap_icon.wrap_basket.top_basket, #headerfixed .basket-link.basket", function (e) { 8346 var _this = $(this); 8347 if (isMobile) { 8348 if (!_this.hasClass("clicked")) { 8349 e.preventDefault(); 8350 _this.addClass("clicked"); 8351 setTimeout(function () { 8352 _this.removeClass("clicked"); 8353 }, 3000); 8354 } 8355 } 8356 }); 8357 8358 /* slide cart */ 8359 $(document).on("mouseenter", "#basket_line .basket_normal:not(.empty_cart):not(.bcart) .basket_block ", function () { 8360 $(this).closest(".basket_normal").find(".popup").addClass("block"); 8361 $(this).closest(".basket_normal").find(".basket_popup_wrapp").stop(true, true).slideDown(150); 8362 }); 8363 $(document).on("mouseleave", "#basket_line .basket_normal .basket_block ", function () { 8364 var th = $(this); 8365 $(this) 8366 .closest(".basket_normal") 8367 .find(".basket_popup_wrapp") 8368 .stop(true, true) 8369 .slideUp(150, function () { 8370 th.closest(".basket_normal").find(".popup").removeClass("block"); 8371 }); 8372 }); 8373 8374 $(document).on("click", ".popup_button_basket", function () { 8375 var th = $(".to-cart[data-item=" + $(this).data("item") + "]"); 8376 8377 var val = th.attr("data-quantity"); 8378 8379 if (!val) $val = 1; 8380 8381 var tmp_props = th.data("props"), 8382 props = "", 8383 part_props = "", 8384 add_props = "N", 8385 fill_prop = {}, 8386 iblockid = th.data("iblockid"), 8387 offer = th.data("offers"), 8388 rid = "", 8389 basket_props = "", 8390 item = th.attr("data-item"); 8391 8392 if (offer != "Y") { 8393 offer = "N"; 8394 } else { 8395 basket_props = th.closest(".prices_tab").find(".bx_sku_props input").val(); 8396 } 8397 if (tmp_props) { 8398 props = tmp_props.split(";"); 8399 } 8400 if (th.data("part_props")) { 8401 part_props = th.data("part_props"); 8402 } 8403 if (th.data("add_props")) { 8404 add_props = th.data("add_props"); 8405 } 8406 if ($(".rid_item").length) { 8407 rid = $(".rid_item").data("rid"); 8408 } else if (th.data("rid")) { 8409 rid = th.data("rid"); 8410 } 8411 8412 fill_prop = fillBasketPropsExt(th, "prop", "bx_ajax_text"); 8413 8414 fill_prop.quantity = val; 8415 fill_prop.add_item = "Y"; 8416 fill_prop.rid = rid; 8417 fill_prop.offers = offer; 8418 fill_prop.iblockID = iblockid; 8419 fill_prop.part_props = part_props; 8420 fill_prop.add_props = add_props; 8421 fill_prop.props = JSON.stringify(props); 8422 fill_prop.item = item; 8423 fill_prop.basket_props = basket_props; 8424 8425 var isDetail = th.closest(".product-action").length || th.closest("#headerfixed.with-product"); 8426 var isSku2 = th.closest(".list-offers").length; 8427 var bIsService = th.closest(".buy_services_wrap").length; 8428 8429 if (!bIsService && (isDetail || isSku2)) { 8430 //var allServicesOn = th.closest('.product-container').find('.buy_services_wrap .services-item [name="buy_switch_services"]:checked'); 8431 var allServicesOn = []; 8432 if (isSku2) { 8433 allServicesOn = th 8434 .closest(".product-container") 8435 .find('.buy_services_wrap .services-item [name="buy_switch_services"]:checked'); 8436 } else { 8437 allServicesOn = $(".product-container").find( 8438 '.buy_services_wrap[data-parent_product="' + item + '"] .services-item [name="buy_switch_services"]:checked' 8439 ); 8440 } 8441 var servicesNeedAdd = []; 8442 allServicesOn.each(function () { 8443 var _this = $(this); 8444 var buttonCart = _this.closest(".services-item").find(".to-cart"); 8445 8446 servicesNeedAdd[buttonCart.data("item")] = {}; 8447 servicesNeedAdd[buttonCart.data("item")]["id"] = buttonCart.data("item"); 8448 servicesNeedAdd[buttonCart.data("item")]["quantity"] = buttonCart.attr("data-quantity"); 8449 servicesNeedAdd[buttonCart.data("item")]["iblock_id"] = buttonCart.data("iblockid"); 8450 }); 8451 servicesNeedAdd = array_values_js(servicesNeedAdd); 8452 fill_prop.services = servicesNeedAdd; 8453 } 8454 8455 $.ajax({ 8456 type: "POST", 8457 url: arAsproOptions["SITE_DIR"] + "ajax/item.php", 8458 data: fill_prop, 8459 dataType: "json", 8460 success: function (data) { 8461 $(".basket_error_frame").jqmHide(); 8462 if ("STATUS" in data) { 8463 getActualBasket(fill_prop.iblockID); 8464 if (data.STATUS === "OK") { 8465 th.hide(); 8466 th.closest(".counter_wrapp").find(".counter_block_inner").hide(); 8467 th.closest(".counter_wrapp").find(".counter_block").hide(); 8468 th.parents("tr").find(".counter_block_wr .counter_block").hide(); 8469 th.closest(".button_block").addClass("wide"); 8470 th.parent().find(".in-cart").show(); 8471 8472 addBasketCounter(item); 8473 8474 if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y"); 8475 8476 if ($("#basket_line .basket_fly").length) { 8477 if (th.closest(".fast_view_frame").length || window.matchMedia("(max-width: 767px)").matches) 8478 basketFly("open", "N"); 8479 else basketFly("open"); 8480 } 8481 } else { 8482 showBasketError(BX.message(data.MESSAGE)); 8483 } 8484 } else { 8485 showBasketError(BX.message("CATALOG_PARTIAL_BASKET_PROPERTIES_ERROR")); 8486 } 8487 }, 8488 }); 8489 }); 8490 8491 $(document).on("click", ".to-cart:not(.read_more), .basket_item_add", function (e) { 8492 e.preventDefault(); 8493 var th = $(this); 8494 if (!th.hasClass("clicked")) { 8495 th.addClass("clicked"); 8496 var val = $(this).attr("data-quantity"); 8497 var tmp_props = $(this).data("props"), 8498 props = "", 8499 part_props = "", 8500 add_props = "N", 8501 fill_prop = {}, 8502 iblockid = $(this).data("iblockid"), 8503 offer = $(this).data("offers"), 8504 rid = "", 8505 bBannerAction = false, 8506 basket_props = "", 8507 item = $(this).attr("data-item"); 8508 if (th.closest(".but-cell").length) { 8509 if ($('.counter_block[data-item="' + item + '"]').length) 8510 val = $('.counter_block[data-item="' + item + '"] input').val(); 8511 } 8512 8513 if (th.closest(".banner_buttons.with_actions").length) { 8514 //banner action 8515 var wrapper_btns = th.closest(".wraps_buttons"); 8516 item = wrapper_btns.data("id"); 8517 bBannerAction = true; 8518 } 8519 8520 if (!val) val = 1; 8521 if (offer != "Y") { 8522 offer = "N"; 8523 } else { 8524 basket_props = $(this).closest(".prices_tab").find(".bx_sku_props input").val(); 8525 } 8526 if (tmp_props) { 8527 props = tmp_props.split(";"); 8528 } 8529 if ($(this).data("part_props")) { 8530 part_props = $(this).data("part_props"); 8531 } 8532 if ($(this).data("add_props")) { 8533 add_props = $(this).data("add_props"); 8534 } 8535 if ($(".rid_item").length) { 8536 rid = $(".rid_item").data("rid"); 8537 } else if ($(this).data("rid")) { 8538 rid = $(this).data("rid"); 8539 } 8540 8541 fill_prop = fillBasketPropsExt(th, "prop", th.data("bakset_div")); 8542 8543 fill_prop.quantity = val; 8544 fill_prop.add_item = "Y"; 8545 fill_prop.rid = rid; 8546 fill_prop.offers = offer; 8547 fill_prop.iblockID = iblockid; 8548 fill_prop.part_props = part_props; 8549 fill_prop.add_props = add_props; 8550 fill_prop.props = JSON.stringify(props); 8551 fill_prop.item = item; 8552 fill_prop.basket_props = basket_props; 8553 8554 var isDetail = th.closest(".product-action").length || th.closest("#headerfixed.with-product"); 8555 var isSku2 = th.closest(".list-offers").length; 8556 var bIsService = th.closest(".buy_services_wrap").length; 8557 8558 if (!bIsService && (isDetail || isSku2)) { 8559 var allServicesOn = []; 8560 if (isSku2) { 8561 allServicesOn = th 8562 .closest(".product-container") 8563 .find('.buy_services_wrap .services-item [name="buy_switch_services"]:checked'); 8564 } else { 8565 allServicesOn = $(".product-container").find( 8566 '.buy_services_wrap[data-parent_product="' + item + '"] .services-item [name="buy_switch_services"]:checked' 8567 ); 8568 } 8569 var servicesNeedAdd = []; 8570 allServicesOn.each(function () { 8571 var _this = $(this); 8572 var buttonCart = _this.closest(".services-item").find(".to-cart"); 8573 servicesNeedAdd[buttonCart.data("item")] = {}; 8574 servicesNeedAdd[buttonCart.data("item")]["id"] = buttonCart.data("item"); 8575 servicesNeedAdd[buttonCart.data("item")]["quantity"] = buttonCart.attr("data-quantity"); 8576 servicesNeedAdd[buttonCart.data("item")]["iblock_id"] = buttonCart.data("iblockid"); 8577 }); 8578 servicesNeedAdd = array_values_js(servicesNeedAdd); 8579 fill_prop.services = servicesNeedAdd; 8580 } 8581 8582 var servicesWrap = $(this).closest(".buy_services_wrap"); 8583 if (bIsService) { 8584 var parent_product = servicesWrap.attr("data-parent_product"); 8585 fill_prop["prop[BUY_PRODUCT_PROP]"] = parent_product; 8586 fill_prop["prop[ASPRO_BUY_PRODUCT_ID]"] = parent_product; 8587 } 8588 8589 if (bBannerAction) { 8590 if (th.hasClass("added")) { 8591 location.href = th.data("href"); 8592 return false;
8593 } else { 8594 th.attr("title", th.data("title2")); 8595 th.toggleClass("added"); 8596 } 8597 } 8598 8599 if (th.data("empty_props") == "N") { 8600 var basket_popup_html = $("#" + th.data("bakset_div")).html(); 8601 if (!basket_popup_html && th.closest(".item").find(".basket_props_block").length) 8602 basket_popup_html = th.closest(".item").find(".basket_props_block").html(); 8603 8604 showBasketError(basket_popup_html, BX.message("ERROR_BASKET_PROP_TITLE"), "Y", th); 8605 BX.addCustomEvent("onCompleteAction", function (e) { 8606 if (!e.ignoreSelf) { 8607 var eventdata = { 8608 action: "loadForm", 8609 ignoreSelf: true, 8610 }; 8611 BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]); 8612 } 8613 }); 8614 } else { 8615 $.ajax({ 8616 type: "POST", 8617 url: arAsproOptions["SITE_DIR"] + "ajax/item.php", 8618 data: fill_prop, 8619 dataType: "json", 8620 success: function (data) { 8621 getActualBasket(fill_prop.iblockID); 8622 8623 var eventdata = { action: "loadForm" }; 8624 BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]); 8625 arStatusBasketAspro = {}; 8626 8627 if (data !== null) { 8628 if ("STATUS" in data) { 8629 if (data.MESSAGE_EXT === null) data.MESSAGE_EXT = ""; 8630 if (data.STATUS === "OK") { 8631 // th.hide(); 8632 $(".to-cart[data-item=" + item + "]").hide(); 8633 $(".to-cart[data-item=" + item + "]") 8634 .closest(".counter_wrapp") 8635 .find(".counter_block_inner") 8636 .hide(); 8637 $(".to-cart[data-item=" + item + "]") 8638 .closest(".counter_wrapp") 8639 .find(".counter_block") 8640 .hide(); 8641 $(".to-cart[data-item=" + item + "]") 8642 .parents("tr") 8643 .find(".counter_block_wr .counter_block") 8644 .hide(); 8645 $(".to-cart[data-item=" + item + "]") 8646 .closest(".button_block") 8647 .addClass("wide"); 8648 // th.parent().find('.in-cart').show(); 8649 $(".in-cart[data-item=" + item + "]").show(); 8650 8651 addBasketCounter(item); 8652 8653 //js notice 8654 $bDontOpenBasket = false; 8655 if (typeof JNoticeSurface !== "undefined") { 8656 JNoticeSurface.get().onAdd2cart([th[0]]); 8657 $bDontOpenBasket = true; 8658 } 8659 // 8660 8661 if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y"); 8662 8663 if ($("#basket_line .basket_fly").length) { 8664 if (th.closest(".services_in_basket").length && !window.matchMedia("(max-width: 767px)").matches) { 8665 basketFly("open", "SHOW"); //need for buy services in basket_fly 8666 } else if ( 8667 th.closest(".fast_view_frame").length || 8668 window.matchMedia("(max-width: 767px)").matches || 8669 $("#basket_line .basket_fly.loaded").length 8670 ) 8671 basketFly("open", "N"); 8672 else { 8673 if ($bDontOpenBasket) basketFly("open", "N"); 8674 else basketFly("open"); 8675 } 8676 } 8677 8678 //need for services on basket_page 8679 if (th.closest(".services_in_basket_page").length) { 8680 BX.Sale.BasketComponent.sendRequest("refreshAjax", { 8681 fullRecalculation: "Y", 8682 otherParams: { 8683 param: "N", 8684 }, 8685 }); 8686 } 8687 8688 if ($(".top_basket").length) { 8689 basketTop($bDontOpenBasket ? "" : "open", $(".top_basket").find(".basket_hover_block")); 8690 } 8691 8692 if ( 8693 $("#headerfixed .wproducts .ajax_load .btn").length && 8694 th.closest(".product-action").length &&
8695 !th.closest(".js-item-analog").length && 8696 th.next(".in-cart").length 8697 ) { 8698 var buttonHtml = 8699 //'<span class="buy_block"><span class="btn btn-default btn-sm slide_offer more type_block">' + 8700 '<span class="buy_block"><span class="btn btn-default btn-sm more type_block">' + 8701 th.next(".in-cart").html() + 8702 "</span></span>"; 8703 $("#headerfixed .wproducts .ajax_load .item-buttons .but-cell").html(buttonHtml); 8704 } 8705 } else { 8706 showBasketError(BX.message(data.MESSAGE) + " <br/>" + data.MESSAGE_EXT); 8707 } 8708 } else { 8709 showBasketError(BX.message("CATALOG_PARTIAL_BASKET_PROPERTIES_ERROR")); 8710 } 8711 } else { 8712 // th.hide(); 8713 $(".to-cart[data-item=" + item + "]").hide(); 8714 $(".to-cart[data-item=" + item + "]") 8715 .closest(".counter_wrapp") 8716 .find(".counter_block_inner") 8717 .hide(); 8718 $(".to-cart[data-item=" + item + "]") 8719 .closest(".counter_wrapp") 8720 .find(".counter_block") 8721 .hide(); 8722 $(".to-cart[data-item=" + item + "]") 8723 .parents("tr") 8724 .find(".counter_block_wr .counter_block") 8725 .hide(); 8726 $(".to-cart[data-item=" + item + "]") 8727 .closest(".button_block") 8728 .addClass("wide"); 8729 // th.parent().find('.in-cart').show(); 8730 $(".in-cart[data-item=" + item + "]").show(); 8731 8732 addBasketCounter(item); 8733 8734 if ($("#ajax_basket").length) reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y"); 8735 8736 if ($("#basket_line .basket_fly").length) { 8737 if ( 8738 th.closest(".fast_view_frame").length || 8739 window.matchMedia("(max-width: 767px)").matches || 8740 $("#basket_line .basket_fly.loaded").length 8741 ) 8742 basketFly("open", "N"); 8743 else basketFly("open"); 8744 } 8745 } 8746 }, 8747 }); 8748 } 8749 } 8750 }); 8751 8752 $(document).on("click", ".to-subscribe", function (e) { 8753 e.preventDefault(); 8754 var th = $(this); 8755 if (!th.hasClass("clicked")) { 8756 th.addClass("clicked"); 8757 if ($(this).is(".auth")) { 8758 if ($(this).hasClass("nsubsc")) { 8759 $(this).jqmEx(); 8760 // $(this).trigger("click"); 8761 } else { 8762 location.href = arAsproOptions["SITE_DIR"] + "auth/?backurl=" + location.pathname; 8763 } 8764 } else { 8765 var item = $(this).attr("data-item"), 8766 iblockid = $(this).attr("data-iblockid"); 8767 // $(this).hide(); 8768 $(".to-subscribe[data-item=" + item + "]").hide(); 8769 $(".to-subscribe[data-item=" + item + "]") 8770 .parent() 8771 .find(".in-subscribe") 8772 .show(); 8773 $.get( 8774 arAsproOptions["SITE_DIR"] + "ajax/item.php?item=" + item + "&subscribe_item=Y", 8775 $.proxy(function (data) { 8776 arStatusBasketAspro = {}; 8777 getActualBasket(iblockid); 8778 }) 8779 ); 8780 th.removeClass("clicked"); 8781 } 8782 } 8783 }); 8784 8785 $(document).on("click", ".in-subscribe", function (e) { 8786 e.preventDefault(); 8787 var item = $(this).attr("data-item"), 8788 iblockid = $(this).attr("data-iblockid"); 8789 // $(this).hide(); 8790 $(".in-subscribe[data-item=" + item + "]").hide(); 8791 $(".in-subscribe[data-item=" + item + "]") 8792 .parent() 8793 .find(".to-subscribe") 8794 .removeClass("clicked"); 8795 $(".in-subscribe[data-item=" + item + "]") 8796 .parent() 8797 .find(".to-subscribe") 8798 .show(); 8799 $.get( 8800 arAsproOptions["SITE_DIR"] + "ajax/item.php?item=" + item + "&subscribe_item=Y", 8801 $.proxy(function (data) { 8802 getActualBasket(iblockid); 8803 arStatusBasketAspro = {}; 8804 }) 8805 ); 8806 }); 8807 8808 $(document).on("click", ".item_main_info .item_slider .flex-direction-nav li span", function (e) { 8809 if ($(".inner_slider .slides_block").length) { 8810 if ($(this).parent().hasClass("flex-nav-next")) $(".inner_slider .slides_block li.current").next().click(); 8811 else $(".inner_slider .slides_block li.current").prev().click(); 8812 } 8813 }); 8814 8815 $(document).on("click", ".tabs>li", function () { 8816 var parent = $(this).parent(); 8817 if (!$(this).hasClass("active")) { 8818 var sliderIndex = $(this).index(), 8819 curLiNav = $(this) 8820 .closest(".top_block") 8821 .find(".slider_navigation") 8822 .find(">li:eq(" + sliderIndex + ")"), 8823 curLi = $(this) 8824 .closest(".top_block") 8825 .siblings(".tabs_content") 8826 .find(">li:eq(" + sliderIndex + ")"); 8827 $(this).addClass("active").addClass("cur").siblings().removeClass("active").removeClass("cur"); 8828 curLi.addClass("cur").siblings().removeClass("cur"); 8829 curLiNav.addClass("cur").siblings().removeClass("cur"); 8830 8831 if (parent.hasClass("ajax")) { 8832 // front tabs 8833 if (!$(this).hasClass("clicked")) { 8834 $.ajax({ 8835 url: arAsproOptions["SITE_DIR"] + "include/mainpage/comp_catalog_ajax.php", 8836 type: "POST", 8837 data: { 8838 AJAX_POST: "Y",
8839 FILTER_HIT_PROP: $(this).data("code"), 8840 AJAX_PARAMS: $(this).closest(".tab_slider_wrapp").find(".request-data").data("value"), 8841 GLOBAL_FILTER: curLi.data("filter"), 8842 }, 8843 success: function (html) { 8844 curLi.find(".tabs_slider").html(html); 8845 var container = curLi.closest(".content_wrapper_block"); 8846 if (container.length) { 8847 var bNav = curLi.find(".bottom_nav .module-pagination").length > 0; 8848 if (bNav) { 8849 container.removeClass("without-border"); 8850 } else { 8851 container.addClass("without-borded"); 8852 } 8853 } 8854 setTimeout(function () { 8855 curLi.addClass("opacity1"); 8856 }, 100); 8857 8858 BX.onCustomEvent("onAjaxResponesTabs", [eventdata]); 8859 }, 8860 }); 8861 $(this).addClass("clicked"); 8862 } else { 8863 var container = curLi.closest(".content_wrapper_block"); 8864 if (container.length) { 8865 var bNav = curLi.find(".bottom_nav .module-pagination").length > 0; 8866 if (bNav) { 8867 container.removeClass("without-border"); 8868 } else { 8869 container.addClass("without-borded"); 8870 } 8871 } 8872 } 8873 } 8874 8875 var eventdata = { index: sliderIndex, target: $(this) }; 8876 BX.onCustomEvent("clickedTabsLi", [eventdata]); 8877 } 8878 }); 8879 8880 /* search click */ 8881 $(".search_block .icon").on("click", function () { 8882 var th = $(this); 8883 if ($(this).hasClass("open")) { 8884 $(this).closest(".center_block").find(".search_middle_block").removeClass("active"); 8885 $(this).removeClass("open"); 8886 $(this).closest(".center_block").find(".search_middle_block").find(".noborder").hide(); 8887 } else { 8888 setTimeout(function () { 8889 th.closest(".center_block").find(".search_middle_block").find(".noborder").show(); 8890 }, 100); 8891 $(this).closest(".center_block").find(".search_middle_block").addClass("active"); 8892 $(this).addClass("open"); 8893 } 8894 }); 8895 8896 $(document).on("click", ".no_goods .button", function () { 8897 $(".bx_filter .smartfilter .bx_filter_search_reset").trigger("click"); 8898 }); 8899 8900 $(document).on("click", ".js-load-link", function (e) { 8901 AjaxClickLink(e); 8902 }); 8903 8904 $(document).on("click", ".svg-inline-bottom_nav-icon", function () { 8905 $(this).next().trigger("click"); 8906 }); 8907 $(document).on("click", ".ajax_load_btn", function () { 8908 var _this = $(this), 8909 url = _this.closest(".container").find(".module-pagination .flex-direction-nav .flex-next").attr("href"), 8910 th = _this.find(".more_text_ajax"), 8911 bottom_nav = _this.closest(".bottom_nav"), 8912 mobileBottomNav = bottom_nav.hasClass("mobile_slider"), 8913 bLoadingState = _this.closest(".animate-load-state").length; 8914 8915 if (!th.hasClass("loading")) { 8916 th.addClass("loading"); 8917 if (mobileBottomNav) { 8918 var icon = bottom_nav.find(".svg-inline-bottom_nav-icon"); 8919 icon.css("display", "none"); 8920 } 8921 if (bLoadingState) _this.addClass("loadings"); 8922 8923 var objUrl = parseUrlQuery(), 8924 add_url = ""; 8925 obGetData = { ajax_get: "Y", AJAX_REQUEST: "Y" }; 8926 8927 if (_this.closest(".wrapper_inner.front").length) { 8928 //index page 8929 var class_block = th.closest(".drag-block").data("class").replace("_drag", ""); 8930 class_block = class_block.replace(/\s/g, ""); 8931 obGetData.BLOCK = class_block; 8932 } 8933 8934 if (_this.closest(".tab").length) { 8935 //tabs block 8936 var parentTab = th.closest(".tab"); 8937 obGetData.FILTER_HIT_PROP = parentTab.data("code"); 8938 obGetData.GLOBAL_FILTER = parentTab.data("filter"); 8939 url = _this.closest(".bottom_nav").find(".module-pagination .flex-direction-nav .flex-next").attr("href"); 8940 } 8941 8942 if (_this.closest(".content_linked_goods").length) { 8943 //linked_goods block in content 8944 var filterSections = th.closest(".content_linked_goods").attr("data-sections-ids"); 8945 obGetData.ajax_section_id = decodeURIComponent(filterSections); 8946 8947 url = _this.closest(".bottom_nav").find(".module-pagination .flex-direction-nav .flex-next").attr("href"); 8948 } 8949 8950 if ("clear_cache" in objUrl) { 8951 if (objUrl.clear_cache == "Y") add_url = "&clear_cache=Y"; 8952 } 8953 if (_this.hasClass("ajax")) obGetData.ajax = "y"; 8954
8955 if (th.closest(".goods-block.ajax_load")) obGetData.bitrix_include_areas = "N"; 8956 8957 if (_this.closest(".nav-data_block").length) { 8958 //need data-block 8959 obGetData.data_block = _this.closest(".nav-data_block").attr("data-block"); 8960 obGetData.pagen_data_block = "Y"; 8961 url = _this.closest(".bottom_nav").find(".module-pagination .flex-direction-nav .flex-next").attr("href"); 8962 } 8963 8964 $.ajax({ 8965 url: url + add_url, 8966 data: obGetData, 8967 success: function (html) { 8968 pasteAjaxPagination(html, th, bottom_nav, bLoadingState, _this); 8969 }, 8970 error: function (html) { 8971 pasteAjaxPagination(html.responseText, th, bottom_nav, bLoadingState, _this); 8972 }, 8973 }); 8974 } 8975 }); 8976 8977 function pasteAjaxPagination(html, th, bottom_nav, bLoadingState, _this) { 8978 var mobileBottomClicked = bottom_nav.hasClass("mobile_slider"); 8979 var hasMobileBottomNav = $(html).find(".bottom_nav.mobile_slider"); 8980 var bottomNav = hasMobileBottomNav.length ? hasMobileBottomNav : $(html).find(".bottom_nav"); 8981 var bottomNavHtml = bottomNav.html(); 8982 var bottomNavScrollClass = bottomNav.data("scroll-class"); 8983 var hasBottomNav = $(html).find(".ajax_load_btn").length; 8984 8985 if (th.closest(".ajax_load").length && !mobileBottomClicked) { 8986 th.removeClass("loading"); 8987 if (th.closest(".ajax_load").find(".js_append").length) { 8988 if (_this.closest(".catalog_in_content").length) { 8989 th.closest(".ajax_load").find(".js_append").append($(".inner_wrapper .js_wrapper_items>", html)); //need for brands & landings 8990 } else if (_this.closest(".catalog.search").length) { 8991 th.closest(".ajax_load").find(".js_append").append($(".js_append>", html)); 8992 } else { 8993 th.closest(".ajax_load").find(".js_append").append(html); 8994 } 8995 th.closest(".ajax_load").find(".bottom_nav_wrapper").remove(); 8996 } else { 8997 if ($(".display_list").length) { 8998 $(".display_list").append(html); 8999 th.closest(".display_list").find(".bottom_nav_wrapper").remove(); 9000 } else if ($(".block_list").length) { 9001 $(".block_list").append(html); 9002 touchItemBlock(".catalog_item a"); 9003 th.closest(".block_list").find(".bottom_nav_wrapper").remove(); 9004 } else if ($(".module_products_list").length) { 9005 $(".module_products_list > tbody").append(html); 9006 th.closest(".module_products_list > tbody").find(".bottom_nav_wrapper").remove(); 9007 } 9008 } 9009 9010 setStatusButton(); 9011 checkLinkedArticles(); 9012 checkLinkedBlocks(".linked-banners-list"); 9013 9014 var eventdata = { action: "ajaxContentLoadedTab" }; 9015 BX.onCustomEvent("onAjaxSuccess", [eventdata]); 9016 _this.closest(".bottom_nav").html(bottomNavHtml); 9017 } else { 9018 var eventdata = { action: "ajaxContentLoaded" }; 9019 9020 if ($(".banners-small.front").length) { 9021 $(".banners-small .items.row").append(html); 9022 $(".bottom_nav").html($(".banners-small .items.row .bottom_nav").html()); 9023 $(".banners-small .items.row .bottom_nav").remove(); 9024 if (hasBottomNav) { 9025 $(".banners-small .items.row").addClass("has-bottom-nav"); 9026 } else { 9027 $(".banners-small .items.row").removeClass("has-bottom-nav"); 9028 } 9029 } else { 9030 if (bottom_nav.data("append") !== undefined && bottom_nav.data("parent") !== undefined) { 9031 var target = html; 9032 if (bottom_nav.data("target") !== undefined) { 9033 target = $(html).find(bottom_nav.data("target")); 9034 } 9035 if (mobileBottomClicked || hasMobileBottomNav.length) { 9036 var mobileSliderNav = th.closest(bottom_nav.data("parent")).find(".bottom_nav.mobile_slider"); 9037 if (mobileSliderNav.length) { 9038 mobileSliderNav.before(target); 9039 } else { 9040 bottom_nav.before(target); 9041 } 9042 } else { 9043 th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).append(target); 9044 } 9045 th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).find(".bottom_nav_wrapper").remove(); 9046 9047 if (hasBottomNav) { 9048 if (bottomNavScrollClass !== undefined) { 9049 th.closest(bottom_nav.data("parent")).find(bottomNavScrollClass).addClass("has-bottom-nav"); 9050 } 9051 th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).addClass("has-bottom-nav"); 9052 } else { 9053 if (bottomNavScrollClass !== undefined) { 9054 th.closest(bottom_nav.data("parent")).find(bottomNavScrollClass).removeClass("has-bottom-nav"); 9055 } 9056 th.closest(bottom_nav.data("parent")).find(bottom_nav.data("append")).removeClass("has-bottom-nav"); 9057 } 9058 9059 bottom_nav = th.closest(bottom_nav.data("parent")).find(".bottom_nav"); 9060 bottom_nav.html(bottomNavHtml); 9061 var icon = bottom_nav.find(".svg-inline-bottom_nav-icon"); 9062 icon.css("display", ""); 9063 9064 eventdata.container = th.closest(bottom_nav.data("parent")); 9065 } else { 9066 if (th.closest(".item-views").find(".items").length) { 9067 th.closest(".item-views").find(".items").append(html); 9068 } else { 9069 $(html).insertBefore($(".blog .bottom_nav")); 9070 } 9071 9072 bottom_nav.html($(".bottom_nav:hidden").html()); 9073 if (hasBottomNav) { 9074 th.closest(".item-views").find(".items").addClass("has-bottom-nav"); 9075 } else { 9076 th.closest(".item-views").find(".items").removeClass("has-bottom-nav"); 9077 } 9078 _this.closest(".item-views").find(".bottom_nav:hidden").remove(); 9079 } 9080 } 9081 9082 eventdata.content = html; 9083 eventdata.container = th; 9084 BX.onCustomEvent("onCompleteAction", [eventdata, th[0]]); 9085 9086 setTimeout(function () { 9087 $(".banners-small .item.normal-block").sliceHeight({ 9088 resize: false, 9089 }); 9090 if ($(".item.slice-item").length) { 9091 $(".item.slice-item .title").sliceHeight({ resize: false }); 9092 $(".item.slice-item").sliceHeight({ resize: false }); 9093 } 9094 th.removeClass("loading"); 9095 if (bLoadingState) _this.removeClass("loadings"); 9096 }, 100); 9097 } 9098 BX.onCustomEvent("onHeaderProgressBarChange", [{}]); 9099 // initCountdown(); 9100 } 9101 9102 // form rating 9103 $(document).on("mouseenter", ".form .votes_block.with-text .item-rating", function () { 9104 var $this = $(this), 9105 index = $this.index(),
9106 ratingValue = $this.data("rating_value"), 9107 ratingMessage = $this.data("message"); 9108 9109 $(this).addClass("filed"); 9110 $this.siblings().each(function () { 9111 if ($(this).index() <= index) $(this).addClass("filed"); 9112 else $(this).removeClass("filed"); 9113 }); 9114 $this.closest(".votes_block").find(".rating_message").text(ratingMessage); 9115 }); 9116 9117 $(document).on("mouseleave", ".form .votes_block.with-text", function () { 9118 var $this = $(this), 9119 index = $this.data("rating"), 9120 ratingMessage = $this.closest(".votes_block").find(".rating_message").data("message"); 9121 9122 $this.find(".item-rating").each(function () { 9123 if ($(this).index() < index && index !== undefined) $(this).addClass("filed"); 9124 else $(this).removeClass("filed"); 9125 }); 9126 $this.closest(".votes_block").find(".rating_message").text(ratingMessage); 9127 }); 9128 9129 $(document).on("click", ".form .votes_block.with-text .item-rating", function () { 9130 const $this = $(this); 9131 const index = $this.index() + 1; 9132 const ratingMessage = $this.data("message"); 9133 const $votesBlock = $this.closest(".votes_block"); 9134 const $formControl = $this.closest(".form-control") 9135 const $ratingInput = $formControl.find("input[name=RATING], input[data-sid=RATING]"); 9136 9137 if ($votesBlock.length){ 9138 $votesBlock.data("rating", index); 9139 $votesBlock.find(".rating_message").data("message", ratingMessage); 9140 } 9141 9142 if ($ratingInput.length) { 9143 $ratingInput.val(index); 9144 $ratingInput.blur(); 9145 } 9146}); 9147 9148 $(document).on("paste, change, keyup", ".form.blog-comment-fields input[required]", function () { 9149 let value = $(this).val(); 9150 9151 if (value.length) { 9152 $(this).closest(".form-group").find("label.error").remove(); 9153 } 9154 }); 9155 9156 //set cookie for basket link click 9157 $(document).on( 9158 "click", 9159 ".bx_ordercart_order_table_container .control > a, .basket-item-actions-remove, a[data-entity=basket-item-remove-delayed]", 9160 function (e) { 9161 $.removeCookie("click_basket", { path: "/" }); 9162 $.cookie("click_basket", "Y", { path: "/" }); 9163 } 9164 ); 9165 9166 $(document).on("click", ".bx_compare .tabs-head li", function () { 9167 var url = $(this).find(".sortbutton").data("href"); 9168 BX.showWait(BX("bx_catalog_compare_block")); 9169 $.ajax({ 9170 url: url, 9171 data: { ajax_action: "Y" }, 9172 success: function (html) { 9173 history.pushState(null, null, url); 9174 $("#bx_catalog_compare_block").html(html); 9175 BX.closeWait(); 9176 }, 9177 }); 9178 }); 9179 var hoveredTrs; 9180 $(document).on( 9181 { 9182 mouseover: function (e) { 9183 var _ = $(this); 9184 var tbodyIndex = _.closest("tbody").index() + 1; //+1 for nth-child 9185 var trIndex = _.index() + 1; // +1 for nth-child 9186 hoveredTrs = $(e.delegateTarget) 9187 .find(".data_table_props") 9188 .children(":nth-child(" + tbodyIndex + ")") 9189 .children(":nth-child(" + trIndex + ")") 9190 .addClass("hovered"); 9191 }, 9192 mouseleave: function (e) { 9193 if (hoveredTrs) hoveredTrs.removeClass("hovered"); 9194 }, 9195 }, 9196 ".bx_compare .data_table_props tbody>tr" 9197 ); 9198 $(document).on("click", ".fancy_zoom", function (e) { 9199 e.preventDefault(); 9200 var arPict = [], 9201 index = 0; 9202 $(this) 9203 .closest(".product-detail-gallery__container") 9204 .find(".gallery-slider-thumb__container .gallery__item--thumb") 9205 .each(function () { 9206 var obImg = {}; 9207 obImg = { 9208 src: $(this).data("big"), 9209 thumb: $(this).find("img").data("src") || $(this).find("img").attr("src"), 9210 // opts: { 9211 // caption: $(this).find("img").attr("alt"), 9212 // }, 9213 }; 9214 if ($(this).hasClass("swiper-slide-thumb-active")) { 9215 index = $(this).index(); 9216 } 9217 arPict.push(obImg); 9218 }); 9219 if (!arPict.length) { 9220 arPict.push({ 9221 src: $(this).closest(".product-detail-gallery__container").find(".zoom_picture").data("xoriginal"), 9222 }); 9223 } 9224 if (typeof $.fn.fancybox !== "function") { 9225 return; 9226 } 9227 $.fancybox.open( 9228 arPict, 9229 { 9230 tpl: { 9231 closeBtn: 9232 '<span title="' + 9233 BX.message("FANCY_CLOSE") + 9234 '" class="fancybox-item fancybox-close inline svg"><svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg></span>', 9235 next: 9236 '<a title="' + 9237 BX.message("FANCY_NEXT") + 9238 '" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>', 9239 prev: 9240 '<a title="' + 9241 BX.message("FANCY_PREV") + 9242 '" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>', 9243 }, 9244 btnTpl: { 9245 close: 9246 '<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}">' + 9247 '<i class="svg"><svg width="26" height="26" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg"><path d="M2 24L24 2M2 2L24 24" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" /></svg></i>' + 9248 "</button>", 9249 9250 arrowLeft: 9251 '<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}">' + 9252 '<div><i class="svg left"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 13L0.585787 14.4142C-0.195262 13.6332 -0.195262 12.3668 0.585787 11.5858L2 13ZM11.5858 0.585786C12.3668 -0.195262 13.6332 -0.195262 14.4142 0.585786C15.1953 1.36683 15.1953 2.63317 14.4142 3.41421L11.5858 0.585786ZM14.4142 22.5858C15.1953 23.3668 15.1953 24.6332 14.4142 25.4142C13.6332 26.1953 12.3668 26.1953 11.5858 25.4142L14.4142 22.5858ZM0.585787 11.5858L11.5858 0.585786L14.4142 3.41421L3.41421 14.4142L0.585787 11.5858ZM3.41421 11.5858L14.4142 22.5858L11.5858 25.4142L0.585787 14.4142L3.41421 11.5858Z" fill="#999999"/></svg></i></div>' + 9253 "</button>", 9254 9255 arrowRight: 9256 '<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}">' + 9257 '<div><i class="svg right"><svg width="16" height="26" viewBox="0 0 15 26" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M13 13L14.4142 14.4142C15.1953 13.6332 15.1953 12.3668 14.4142 11.5858L13 13ZM3.41421 0.585786C2.63317 -0.195262 1.36683 -0.195262 0.585786 0.585786C-0.195262 1.36683 -0.195262 2.63317 0.585786 3.41421L3.41421 0.585786ZM0.585786 22.5858C-0.195262 23.3668 -0.195262 24.6332 0.585786 25.4142C1.36683 26.1953 2.63317 26.1953 3.41421 25.4142L0.585786 22.5858ZM14.4142 11.5858L3.41421 0.585786L0.585786 3.41421L11.5858 14.4142L14.4142 11.5858ZM11.5858 11.5858L0.585786 22.5858L3.41421 25.4142L14.4142 14.4142L11.5858 11.5858Z" fill="white"/></svg></i></div>' + 9258 "</button>", 9259 }, 9260 touch: "enabled", 9261 loop: false, 9262 buttons: [ 9263 // "zoom", 9264 //"share", 9265 // "slideShow", 9266 //"fullScreen", 9267 //"download", 9268 // "thumbs", 9269 "close", 9270 ], 9271 thumbs: { 9272 autoStart: true, 9273 }, 9274 onActivate: function (instance) { 9275 InitFancyboxThumbnailsGallery(instance); 9276 }, 9277 beforeShow: function (instance, current) { 9278 if ($(".fancybox-thumbs .swiper").length) { 9279 const swiper = $(".fancybox-thumbs .swiper").data("swiper"); 9280 swiper.slideTo(current.index); 9281 } 9282 }, 9283 }, 9284 index 9285 ); 9286 }); 9287 9288 /* tabs */ 9289 $(".tabs_section .tabs-head li").on("click", function () { 9290 if (!$(this).is(".current")) { 9291 $(".tabs_section .tabs-head li").removeClass("current"); 9292 $(this).addClass("current"); 9293 $(".tabs_section ul.tabs_content li").removeClass("current"); 9294 if ($(this).attr("id") == "product_reviews_tab") { 9295 $(".shadow.common").hide(); 9296 $("#reviews_content").show(); 9297 } else { 9298 $(".shadow.common").show(); 9299 $("#reviews_content").hide(); 9300 $(".tabs_section ul.tabs_content > li:eq(" + $(this).index() + ")").addClass("current"); 9301 } 9302 } 9303 }); 9304 9305 /* open first section slide */ 9306 setTimeout(function () { 9307 $(".jobs_wrapp .item:first .name tr").trigger("click"); 9308 }, 300); 9309 9310 $(".choise").on("click", function () { 9311 var _this = $(this); 9312 if (typeof _this.attr("data-block") != "undefined") { 9313 if ($(_this.attr("data-block")).closest(".tab-pane").length) { 9314 $('.ordered-block a[href="#' + $(_this.attr("data-block")).closest(".tab-pane").attr("id") + '"]').click(); 9315 _this.data("block", ".ordered-block.tabs-block"); 9316 $(_this.data("block")).data("offset", -100); 9317 } else { 9318 $(_this.data("block")).data("offset", -100); 9319 } 9320 scrollToBlock(_this.data("block")); 9321 } 9322 }); 9323 9324 $(document).on("click", ".buy_block .slide_offer", function () { 9325 scroll_block($(".js-offers-scroll")); 9326 }); 9327 $(".share > .share_wrapp .text").on("click", function () { 9328 var block = $(this).parent().find(".shares"); 9329 if (!block.is(":visible") && !$(this).closest(".share.top").length) $("#content").css("z-index", 3); 9330 block.fadeToggle(100, function () { 9331 if (!block.is(":visible")) $("#content").css("z-index", 2); 9332 }); 9333 }); 9334 $("html, body").on("mousedown", function (e) { 9335 if (typeof e.target.className == "string" && e.target.className.indexOf("adm") < 0) { 9336 e.stopPropagation(); 9337 $("div.shares").fadeOut(100, function () { 9338 $("#content").css("z-index", 2); 9339 $(".price_txt .share_wrapp").removeClass("opened"); 9340 }); 9341 $(".search_middle_block").removeClass("active_wide"); 9342 } 9343 }); 9344 $(".share_wrapp") 9345 .find("*") 9346 .on("mousedown", function (e) { 9347 e.stopPropagation(); 9348 }); 9349 9350 $(".price_txt .share_wrapp .text").click(function () { 9351 $(this).parent().toggleClass("opened"); 9352 $(this).parent().find(".shares").fadeToggle(); 9353 }); 9354 9355 $(document).on("click", ".reviews-collapse-link", function () { 9356 $(".reviews-reply-form").slideToggle(); 9357 }); 9358 9359 /* accordion action*/ 9360 $(".panel-collapse").on("hidden.bs.collapse", function () { 9361 $(this).parent().toggleClass("opened"); 9362 }); 9363 $(".panel-collapse").on("show.bs.collapse", function () { 9364 $(this).parent().toggleClass("opened"); 9365 }); 9366 9367 /* accordion */ 9368 $(".accordion-head").on("click", function (e) { 9369 e.preventDefault(); 9370 if (!$(this).next().hasClass("collapsing")) { 9371 $(this).toggleClass("accordion-open"); 9372 $(this).toggleClass("accordion-close"); 9373 } 9374 }); 9375 9376 /* progress bar */ 9377 $("[data-appear-progress-animation]").iAppear( 9378 function () { 9379 var $this = $(this);
9380 var delay = $this.attr("data-appear-animation-delay") ? $this.attr("data-appear-animation-delay") : 1; 9381 if (delay > 1) $this.css("animation-delay", delay + "ms"); 9382 $this.addClass($this.attr("data-appear-animation")); 9383 9384 setTimeout(function () { 9385 $this.animate( 9386 { 9387 width: $this.attr("data-appear-progress-animation"), 9388 }, 9389 1500, 9390 "easeOutQuad", 9391 function () { 9392 $this.find(".progress-bar-tooltip").animate( 9393 { 9394 opacity: 1, 9395 }, 9396 500, 9397 "easeOutQuad" 9398 ); 9399 } 9400 ); 9401 }, delay); 9402 }, 9403 { 9404 rootMargin: "-50px 0px -50px 0px", 9405 accX: 0, 9406 accY: -50, 9407 } 9408 ); 9409 9410 // initCountdown(); 9411 9412 /* portfolio item */ 9413 if ($(".item.animated-block").length) { 9414 $(".item.animated-block").iAppear( 9415 function () { 9416 var $this = $(this); 9417 9418 $this.addClass($this.data("animation")).addClass("visible"); 9419 }, 9420 { accX: 0, accY: 150 } 9421 ); 9422 } 9423 9424 typeof InitAppear === 'function' && InitAppear(); 9425 9426 /* js-load-block appear */ 9427 if ($(".js-load-block").length) { 9428 var objUrl = parseUrlQuery(); 9429 var bClearCache = false; 9430 if ("clear_cache" in objUrl) { 9431 if (objUrl.clear_cache == "Y") { 9432 bClearCache = true; 9433 } 9434 } 9435 9436 var items = []; 9437 var bIdle = true; 9438 var insertNextBlockContent = function () { 9439 if (bIdle && items.length) { 9440 bIdle = false; 9441 const item = items.pop(); 9442 9443 // get content 9444 $.get(item.url).done(function (html) { 9445 item.content = html; 9446 item.content = $.trim(item.content); 9447 9448 // remove /bitrix/js/main/core/core_window.js if it was loaded already 9449 if (item.content.indexOf("/bitrix/js/main/core/core_window.") !== -1 && BX.WindowManager) { 9450 item.content = item.content.replace( 9451 /<script src="\/bitrix\/js\/main\/core\/core_window\.[^>]*><\/script>/gm, 9452 "" 9453 ); 9454 } 9455 9456 // remove /bitrix/js/currency/core_currency.js if it was loaded already 9457 if ( 9458 item.content.indexOf("/bitrix/js/currency/core_currency.") !== -1 && 9459 typeof BX.Currency === "object" && 9460 BX.Currency.defaultFormat 9461 ) { 9462 item.content = item.content.replace( 9463 /<script src="\/bitrix\/js\/currency\/core_currency\.[^>]*><\/script>/gm, 9464 "" 9465 ); 9466 } 9467 9468 // remove /bitrix/js/main/pageobject/pageobject.js if it was loaded already 9469 if (item.content.indexOf("/bitrix/js/main/pageobject/pageobject.") !== -1 && BX.PageObject) { 9470 item.content = item.content.replace( 9471 /<script src="\/bitrix\/js\/main\/pageobject\/pageobject\.[^>]*><\/script>/gm, 9472 "" 9473 ); 9474 } 9475 9476 // remove /bitrix/js/main/polyfill/promise/js/promise.js if it not need 9477 if ( 9478 item.content.indexOf("/bitrix/js/main/polyfill/promise/js/promise.") !== -1 && 9479 typeof window.Promise !== "undefined" && 9480 window.Promise.toString().indexOf("[native code]") !== -1 9481 ) { 9482 item.content = item.content.replace( 9483 /<script src="\/bitrix\/js\/main\/polyfill\/promise\/js\/promise\.[^>]*><\/script>/gm, 9484 "" 9485 ); 9486 } 9487 9488 if ( 9489 typeof MutationObserver === "function" && 9490 document.querySelector("body").classList.contains("detail_page") 9491 ) { 9492 const observer = new MutationObserver(function (list, observer) { 9493 const $curBlock = list[0].target; 9494 const curBlockBounds = $curBlock.getBoundingClientRect(); 9495 9496 if ($curBlock.parentElement.classList.contains("complect-block")) { 9497 $curBlock.parentElement.classList.add("loaded"); 9498 } 9499 9500 if (curBlockBounds.top < 0 && curBlockBounds.bottom >= 0) { 9501 const offsetTop = window.scrollY + Math.round($curBlock.offsetHeight) - 100; 9502 window.scrollTo(0, offsetTop); 9503 } 9504 9505 observer.disconnect(); 9506 }); 9507 9508 observer.observe(item.$context[0], { 9509 childList: true, 9510 }); 9511 } 9512 9513 const ob = BX.processHTML(item.content); 9514 9515 // stop ya metrika webvisor DOM indexer 9516 pauseYmObserver(); 9517 9518 item.$context.removeAttr("data-file").removeClass("loader_circle"); 9519 item.$target.innerHTML = ob.HTML; 9520 9521 BX.ajax.processScripts(ob.SCRIPT); 9522 9523 var eventdata = { action: "jsLoadBlock" }; 9524 BX.onCustomEvent("onCompleteAction", [eventdata, item.$context]); 9525 9526 BX.onCustomEvent("onHeaderProgressBarChange", [{}]); 9527 9528 // resume ya metrika webvisor 9529 // 500ms 9530 setTimeout(resumeYmObserver, 500); 9531 9532 bIdle = true; 9533 insertNextBlockContent(); 9534 }); 9535 } 9536 }; 9537 9538 $(".js-load-block").iAppear( 9539 function () { 9540 var $this = $(this); 9541 9542 if ($this.data("file")) { 9543 const add_url = new URL(location.origin + $this.data("file")); 9544 9545 if (bClearCache) add_url.searchParams.set("clear_cache", "Y"); 9546 if ($this.data("block")) add_url.searchParams.set("BLOCK", $this.data("block")); 9547 if ($this.data("show_all")) add_url.searchParams.set("SHOW_ALL", "Y"); 9548 9549 const $target = $this.data("appendTo") 9550 ? $this.find($this.data("appendTo"))[0] 9551 : $this.find('> div[id*="bx_incl_"]').length 9552 ? $this.find('> div[id*="bx_incl_"]')[0] 9553 : $this[0]; 9554 9555 items.unshift({ 9556 $target: $target, 9557 $context: $this, 9558 url: add_url, 9559 }); 9560 insertNextBlockContent(); 9561 } 9562 }, 9563 { 9564 rootMargin: isMobile ? "300px 0px 300px 0px" : "150px 0px 150px 0px", 9565 accX: 0, 9566 accY: isMobile ? 300 : 150, 9567 } 9568 ); 9569 } 9570 9571 /* show ajax store amount product */ 9572 $(document).on("click", ".js-show-info-block", function (e) { 9573 var $this = $(this); 9574 9575 //check on ".cost.prices" need for popup price in mobile 9576 if (window.matchMedia("(max-width: 500px)").matches && !$this.closest(".cost.prices").length) { 9577 return; 9578 } 9579 9580 e.stopPropagation(); 9581 $(".js-info-block").fadeOut(); 9582 9583 if ($this.hasClass("opened")) { 9584 $(".js-show-info-block").removeClass("opened"); 9585 } else { 9586 $(".js-show-info-block").removeClass("opened"); 9587 $this.addClass("opened"); 9588 } 9589 9590 if (!$this.siblings(".js-info-block").length) { 9591 var dataFields = $this.closest(".sa_block").data("fields"); 9592 dataFields = dataFields == "null" || dataFields === undefined ? "" : dataFields; 9593 var dataUserFields = $this.closest(".sa_block").data("user-fields"); 9594 dataUserFields = dataUserFields == "null" || dataUserFields === undefined ? "" : dataUserFields; 9595 var objUrl = parseUrlQuery(), 9596 add_url = ""; 9597 if ("clear_cache" in objUrl) { 9598 if (objUrl.clear_cache == "Y") add_url += "?clear_cache=Y"; 9599 } 9600 9601 var obPostParams = { 9602 ajax: "Y", 9603 ELEMENT_ID: $this.data("id"), 9604 FIELDS: dataFields, 9605 USER_FIELDS: dataUserFields, 9606 STORES: $this.closest(".sa_block").data("stores") || "", 9607 }; 9608 9609 $this.addClass("loadings"); 9610 $.post(arAsproOptions["SITE_DIR"] + "ajax/productStoreAmountCompact.php" + add_url, obPostParams).done(function ( 9611 html 9612 ) { 9613 $this.removeClass("loadings"); 9614 $(html).appendTo($this.closest(".sa_block")); 9615 9616 $this 9617 .siblings(".js-info-block") 9618 .find(".more-btn a") 9619 .attr("href", $this.closest(".item_info").find("a").attr("href")); 9620 // InitScrollBar(); 9621 9622 var eventdata = { action: "jsShowStores" }; 9623 BX.onCustomEvent("onCompleteAction", [eventdata, $this]); 9624 }); 9625 } else { 9626 if ($this.hasClass("opened")) { 9627 $this 9628 .siblings(".js-info-block") 9629 .find(".more-btn a") 9630 .attr("href", $this.closest(".item_info").find("a").attr("href")); 9631 $this.siblings(".js-info-block").fadeIn(); 9632 // InitScrollBar(); 9633 } else { 9634 $this.siblings(".js-info-block").fadeOut(); 9635 } 9636 } 9637 }); 9638 $(document).on("click", ".js-info-block .svg-inline-close", function () { 9639 $(".js-show-info-block").removeClass("opened");
9640 $(this).closest(".js-info-block").fadeOut(); 9641 }); 9642 9643 /* adaptive menu start */ 9644 $(".menu.adaptive").on("click", function () { 9645 $(this).toggleClass("opened"); 9646 if ($(this).hasClass("opened")) { 9647 $(".mobile_menu").toggleClass("opened").slideDown(); 9648 } else { 9649 $(".mobile_menu").toggleClass("opened").slideUp(); 9650 } 9651 }); 9652 $(".mobile_menu .has-child >a").on("click", function (e) { 9653 var parentLi = $(this).parent(); 9654 e.preventDefault(); 9655 parentLi.toggleClass("opened"); 9656 parentLi.find(".dropdown").slideToggle(); 9657 }); 9658 9659 $(".mobile_menu .search-input-div input").on("keyup", function (e) { 9660 var inputValue = $(this).val(); 9661 $(".center_block .stitle_form input").val(inputValue); 9662 if (e.keyCode == 13) { 9663 $(".center_block .stitle_form form").submit(); 9664 } 9665 }); 9666 9667 $(".center_block .stitle_form input").on("keyup", function (e) { 9668 var inputValue = $(this).val(); 9669 $(".mobile_menu .search-input-div input").val(inputValue); 9670 if (e.keyCode == 13) { 9671 $(".center_block .stitle_form form").submit(); 9672 } 9673 }); 9674 9675 $(".mobile_menu .search-button-div button").on("click", function (e) { 9676 e.preventDefault(); 9677 var inputValue = $(this).parents().find("input").val(); 9678 $(".center_block .stitle_form input").val(inputValue); 9679 $(".center_block .stitle_form form").submit(); 9680 }); 9681 /* adaptive menu end */ 9682 9683 $(document).on("click", ".mega-menu .dropdown-menu", function (e) { 9684 e.stopPropagation(); 9685 }); 9686 9687 $(document).on("click", ".mega-menu .dropdown-toggle.more-items", function (e) { 9688 e.preventDefault(); 9689 }); 9690 9691 $(document).on("mouseenter", "#headerfixed .table-menu .dropdown-menu .dropdown-submenu", function () { 9692 setTimeout(function () { 9693 CheckTopVisibleMenu(); 9694 }, 275); 9695 }); 9696 9697 $(".mega-menu .search-item .search-icon, .menu-row #title-search .fa-close").on("click", function (e) { 9698 e.preventDefault(); 9699 $(".menu-row #title-search").toggleClass("hide"); 9700 }); 9701 9702 $(".mega-menu ul.nav .search input").on("keyup", function (e) { 9703 var inputValue = $(this).val(); 9704 $(".menu-row > .search input").val(inputValue); 9705 if (e.keyCode == 13) { 9706 $(".menu-row > .search form").submit(); 9707 } 9708 }); 9709 9710 $(".menu-row > .search input").on("keyup", function (e) { 9711 var inputValue = $(this).val(); 9712 $(".mega-menu ul.nav .search input").val(inputValue); 9713 if (e.keyCode == 13) { 9714 $(".menu-row > .search form").submit(); 9715 } 9716 }); 9717 9718 $(".mega-menu ul.nav .search button").on("click", function (e) { 9719 e.preventDefault(); 9720 var inputValue = $(this).parents(".search").find("input").val(); 9721 $(".menu-and-search .search input").val(inputValue); 9722 $(".menu-row > .search form").submit(); 9723 }); 9724 9725 $(".btn.btn-add").on("click", function () { 9726 $.ajax({ 9727 type: "GET", 9728 url: arAsproOptions["SITE_DIR"] + "ajax/clearBasket.php", 9729 success: function (data) {}, 9730 }); 9731 }); 9732 9733 $(".sort_display a").on("click", function () { 9734 $(this).siblings().removeClass("current"); 9735 $(this).addClass("current"); 9736 }); 9737 9738 /* detail order show payments */ 9739 $(".sale-order-detail-payment-options-methods-info-change-link").on("click", function () { 9740 $(this).closest(".sale-order-detail-payment-options-methods-info").addClass("opened").siblings().addClass("opened"); 9741 }); 9742 9743 /* expand/hide filter values */ 9744 $(document).on("click", ".expand_block", function () { 9745 togglePropBlock($(this)); 9746 }); 9747 9748 /* touch event */ 9749 document.addEventListener( 9750 "touchend", 9751 function (event) { 9752 if (!$(event.target).closest(".menu-item").length && !$(event.target).hasClass("menu-item")) { 9753 $(".menu-row .dropdown-menu").css({ 9754 display: "none", 9755 opacity: 0, 9756 }); 9757 $(".menu-item").removeClass("hover"); 9758 $(".bx-breadcrumb-item.drop").removeClass("hover"); 9759 } 9760 if (!$(event.target).closest(".menu.topest").length) { 9761 if (window.matchMedia("(max-width: 991px)").matches) { 9762 $(".menu.topest").css({ overflow: "hidden" }); 9763 } 9764 $(".menu.topest > li").removeClass("hover"); 9765 } 9766 if (!$(event.target).closest(".full.has-child").length) { 9767 $(".menu_top_block.catalog_block li").removeClass("hover"); 9768 } 9769 if (!$(event.target).closest(".basket_block").length) { 9770 $(".basket_block .link").removeClass("hover");
9771 $(".basket_block .basket_popup_wrapp").slideUp(); 9772 } 9773 if (!$(event.target).closest(".catalog_item").length) { 9774 var tabsContentUnhoverHover = $(".tab:visible").attr("data-unhover") * 1; 9775 $(".tab:visible").stop().animate({ height: tabsContentUnhoverHover }, 100); 9776 $(".tab:visible").find(".catalog_item").removeClass("hover"); 9777 $(".tab:visible").find(".catalog_item .buttons_block").stop().fadeOut(233); 9778 if ($(".catalog_block").length) { 9779 $(".catalog_block").find(".catalog_item_wrapp").removeClass("hover"); 9780 $(".catalog_block").find(".catalog_item").removeClass("hover"); 9781 } 9782 } 9783 //togglePropBlock($(event.target)); 9784 }, 9785 false 9786 ); 9787 9788 touchMenu(".menu-row .menu-item"); 9789 touchTopMenu(".menu.topest li"); 9790 touchLeftMenu(".menu_top_block:not(.in-search) li.full"); 9791 touchBreadcrumbs(".bx-breadcrumb-item.drop"); 9792 9793 $(document).on("keyup", ".coupon .input_coupon input", function () { 9794 if ($(this).val().length) { 9795 $(this).removeClass("error"); 9796 $(this).closest(".input_coupon").find(".error").remove(); 9797 } else { 9798 $(this).addClass("error"); 9799 $("<label class='error'>" + BX.message("INPUT_COUPON") + "</label>").insertBefore($(this)); 9800 } 9801 }); 9802 // showPhoneMask("input[autocomplete=tel]"); 9803 BX.addCustomEvent(window, "onAjaxSuccessFilter", function (e) { 9804 setBasketStatusBtn(); 9805 checkLinkedArticles(); 9806 checkLinkedBlocks(".linked-banners-list"); 9807 }); 9808 9809 $(document).on("click", ".block_container .items .item.initied", function () { 9810 var _this = $(this), 9811 itemID = _this.data("id"), 9812 animationTime = 200; 9813 9814 _this.closest(".items").fadeOut(animationTime, function () { 9815 _this.closest(".block_container").find(".detail_items").fadeIn(animationTime); 9816 _this 9817 .closest(".block_container") 9818 .find(".detail_items .item[data-id=" + itemID + "]") 9819 .fadeIn(animationTime); 9820 9821 var arCoordinates = _this.data("coordinates").split(","); 9822 9823 if (typeof map !== "undefined") map.setCenter([arCoordinates[0], arCoordinates[1]], 15); 9824 }); 9825 }); 9826 9827 $(document).on("click", ".block_container .top-close", function () { 9828 var _this = $(this).closest(".block_container").find(".detail_items .item:visible"), 9829 animationTime = 200; 9830 _this.fadeOut(animationTime); 9831 _this 9832 .closest(".block_container") 9833 .find(".detail_items") 9834 .fadeOut(animationTime, function () { 9835 _this.closest(".block_container").find(".items").fadeIn(animationTime); 9836 9837 if (typeof map !== "undefined" && typeof clusterer !== "undefined") { 9838 map.setBounds(clusterer.getBounds(), { 9839 zoomMargin: 40, 9840 // checkZoomRange: true 9841 }); 9842 } 9843 }); 9844 }); 9845 9846 BX.addCustomEvent(window, "onAjaxSuccess", function (e) { 9847 if (e != "OK") { 9848 initSelects(document); 9849 InitOrderCustom(); 9850 // showPhoneMask("input[autocomplete=tel]"); 9851 9852 if (arAsproOptions["PAGES"]["CATALOG_PAGE"] && $(".catalog_detail").length && !$(".fast_view_frame").length) { 9853 const leftBlock = $(".main-catalog-wrapper > .left_block"); 9854 const rightBlock = $(".right_block"); 9855 9856 if (!leftBlock.length && rightBlock.hasClass("wide_N")) { 9857 rightBlock.removeClass("wide_N").addClass("wide_Y"); 9858 } else if (leftBlock.length && rightBlock.hasClass("wide_Y")) { 9859 rightBlock.removeClass("wide_Y").addClass("wide_N"); 9860 } 9861 9862 $(".bx_filter").remove(); 9863 InitOwlSlider(); 9864 } 9865 9866 if (arAsproOptions["PAGES"]["CATALOG_PAGE"]) { 9867 // initCountdown(); 9868 9869 if (typeof window["stickySidebar"] !== "undefined") window["stickySidebar"].updateSticky(); 9870 } 9871 9872 if (typeof orderActions === "function") { 9873 orderActions(e); 9874 } 9875 9876 if (e && typeof e === "object" && "action" in e && e.action === "ajaxContentLoadedTab") { 9877 lazyLoadPagenBlock(); 9878 } 9879 9880 InitStickySideBar(); 9881 } 9882 }); 9883 9884 //event for default basket quantity change 9885 BX.addCustomEvent(window, "OnBasketChange", function (e) { 9886 if (arAsproOptions["PAGES"]["BASKET_PAGE"]) { 9887 var summ = 0, 9888 title = ""; 9889 9890 if (typeof BX.Sale !== "undefined") { 9891 if (typeof BX.Sale.BasketComponent !== "undefined") { 9892 summ = BX.Sale.BasketComponent.result.allSum; 9893 title = BX.message("JS_BASKET_COUNT_TITLE").replace("SUMM", summ); 9894 } 9895 } else { 9896 summ = $("#allSum_FORMATED") 9897 .html() 9898 .replace(/ /g, " "); 9899 title = BX.message("JS_BASKET_COUNT_TITLE").replace("SUMM", summ); 9900 } 9901 9902 if ($(".js-basket-block .wrap .prices").length) $(".js-basket-block .wrap .prices").html(summ); 9903 if ($("a.basket-link.basket").length) $("a.basket-link.basket").attr("title", title); 9904 if ($(".basket_fly .opener .basket_count").length) $(".basket_fly .opener .basket_count").attr("title", title); 9905 } 9906 }); 9907}); 9908 9909if (!funcDefined("setBasketStatusBtn")) { 9910 setBasketStatusBtn = function (type) { 9911 var bSync = typeof type !== undefined; 9912 if (typeof arBasketAspro !== "undefined") { 9913 if ("BASKET" in arBasketAspro) { 9914 // basket items 9915 if (arBasketAspro.BASKET) { 9916 for (var i in arBasketAspro.BASKET) { 9917 $(".to-cart[data-item=" + i + "]").hide(); 9918 $(".counter_block[data-item=" + i + "]") 9919 .closest(".counter_block_inner") 9920 .hide(); 9921 $(".counter_block[data-item=" + i + "]").hide(); 9922 $(".in-cart[data-item=" + i + "]").show(); 9923 $(".in-cart[data-item=" + i + "]") 9924 .closest(".button_block") 9925 .addClass("wide"); 9926 9927 if ($(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").length) { 9928 $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").addClass("added"); 9929 $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").attr( 9930 "title", 9931 $(".banner_buttons.with_actions .wraps_buttons[data-id=" + i + "] .basket_item_add").data("title2") 9932 ); 9933 } 9934 } 9935 } 9936 } 9937 9938 /* services */ 9939 if ("SERVICES" in arBasketAspro) { 9940 // services items 9941 $needFillServices = $(".buy_services_wrap[data-parent_product]").length; 9942 if (arBasketAspro.SERVICES && $needFillServices) { 9943 for (var i in arBasketAspro.SERVICES) { 9944 var serviceItem = $( 9945 ".buy_services_wrap[data-parent_product=" + 9946 arBasketAspro.SERVICES[i].link_id + 9947 "] .services-item[data-item_id=" + 9948 arBasketAspro.SERVICES[i].item_id + 9949 "]" 9950 ); 9951 serviceItem.find('input[name="buy_switch_services"]').prop("checked", true); 9952 serviceItem.find('.counter_block input[name="quantity"]').val(arBasketAspro.SERVICES[i].quantity); 9953 serviceItem.addClass("services_on"); 9954 } 9955 } 9956 } 9957 9958 if ("SUBSCRIBE" in arBasketAspro) { 9959 // subscribe items 9960 if (arBasketAspro.SUBSCRIBE) { 9961 for (var i in arBasketAspro.SUBSCRIBE) { 9962 $(".to-subscribe[data-item=" + i + "]").hide(); 9963 $(".in-subscribe[data-item=" + i + "]").show(); 9964 } 9965 } 9966 } 9967 } 9968 9969 BX.onCustomEvent("onSetBasketStatusBtn", []); 9970 }; 9971} 9972 9973if (!funcDefined("togglePropBlock")) { 9974 togglePropBlock = function (className) { 9975 var all_props_block = className.closest(".bx_filter_parameters_box_container").find(".hidden_values"); 9976 if (all_props_block.length && (className.hasClass("inner_text") || className.hasClass("expand_block"))) { 9977 if (all_props_block.is(":visible")) { 9978 className.text(BX.message("FILTER_EXPAND_VALUES")); 9979 all_props_block.hide(); 9980 } else { 9981 className.text(BX.message("FILTER_HIDE_VALUES")); 9982 all_props_block.show(); 9983 } 9984 } 9985 }; 9986} 9987 9988if (!funcDefined("showPhoneMask")) { 9989 showPhoneMask = function (className) { 9990 if (typeof appAspro === "object" && appAspro && appAspro.phone) { 9991 appAspro.phone.init($(className)); 9992 } 9993 }; 9994} 9995 9996if (!funcDefined("getActualBasket")) { 9997 getActualBasket = function (iblockID, type, sync) { 9998 var data = ""; 9999 if (typeof iblockID !== "undefined" && iblockID) { 10000 data = { iblockID: iblockID }; 10001 } 10002 $.ajax({ 10003 type: "GET", 10004 url: arAsproOptions["SITE_DIR"] + "ajax/actualBasket.php", 10005 data: data, 10006 success: function (data) { 10007 if (!$(".js_ajax").length) $("body").append('<div class="js_ajax"></div>'); 10008 $(".js_ajax").html(data); 10009 10010 if (typeof sync !== "undefined") { 10011 setBasketStatusBtn(true); 10012 } 10013 10014 if (typeof type !== undefined) { 10015 var eventdata = { action: "loadActualBasket" + type }; 10016 BX.onCustomEvent("onCompleteAction", [eventdata]); 10017 } 10018 }, 10019 }); 10020 }; 10021} 10022 10023if (!funcDefined("reloadBasketCounters")) { 10024 reloadBasketCounters = function (count, sync) { 10025 var data = ""; 10026 if (count) { 10027 $(".basket-link.basket .count, .wraps_icon_block.basket .count .items > span").text(count); 10028 } else { 10029 $.ajax({ 10030 type: "GET", 10031 url: arAsproOptions["SITE_DIR"] + "ajax/actualBasket.php", 10032 data: data, 10033 success: function (data) { 10034 if (!$(".js_ajax").length) $("body").append('<div class="js_ajax"></div>'); 10035 $(".js_ajax").html(data); 10036 var countServices = 10037 typeof arBasketAspro.SERVICES !== "undefined" ? Object.keys(arBasketAspro.SERVICES).length : 0; 10038 $(".basket-link.basket .count, .wraps_icon_block.basket .count .items > span").text( 10039 Object.keys(arBasketAspro.BASKET).length + countServices 10040 ); 10041 $(".basket-link.delay .count, .wraps_icon_block.delay .count .items > span").text( 10042 arBasketAspro.FAVORITE.COUNT 10043 ); 10044 $(".basket-link.compare .count, .wraps_icon_block.compare .count .items > span").text( 10045 arBasketAspro.COMPARE.COUNT 10046 ); 10047 10048 if (typeof sync !== "undefined") { 10049 setBasketStatusBtn(true); 10050 } 10051 }, 10052 }); 10053 } 10054 }; 10055} 10056 10057function touchMenu(selector) { 10058 if (isMobile) { 10059 if ($(selector).length) { 10060 $(selector).each(function () { 10061 var th = $(this); 10062 th.on("touchend", function (e) { 10063 var _th = $(e.target).closest(".menu-item"); 10064 10065 $(".menu.topest > li").removeClass("hover"); 10066 $(".menu_top_block.catalog_block li").removeClass("hover"); 10067 $(".bx-breadcrumb-item.drop").removeClass("hover"); 10068 10069 if (_th.find(".dropdown-menu").length && !_th.hasClass("hover")) { 10070 e.preventDefault(); 10071 e.stopPropagation(); 10072 _th.siblings().removeClass("hover"); 10073 _th.addClass("hover"); 10074 $(".menu-row .dropdown-menu").css({ 10075 display: "none", 10076 opacity: 0, 10077 }); 10078 if (_th.hasClass("menu-item")) { 10079 _th.closest(".dropdown-menu").css({ 10080 display: "block", 10081 opacity: 1, 10082 }); 10083 } 10084 if (_th.find("> .wrap > .dropdown-menu")) { 10085 _th.find("> .wrap > .dropdown-menu").css({ 10086 display: "block", 10087 opacity: 1, 10088 }); 10089 } else if (_th.find("> .dropdown-menu")) { 10090 _th.find("> .dropdown-menu").css({ 10091 display: "block", 10092 opacity: 1, 10093 }); 10094 } 10095 CheckTopVisibleMenu(); 10096 } else { 10097 var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href"); 10098 if (href && href !== "undefined") location.href = href; 10099 } 10100 }); 10101 }); 10102 } 10103 } else { 10104 $(selector).off(); 10105 } 10106} 10107 10108function touchTopMenu(selector) { 10109 if (isMobile) { 10110 if ($(selector).length) { 10111 $(selector).each(function () { 10112 var th = $(this); 10113 th.on("touchend", function (e) { 10114 var _th = $(e.target).closest("li"); 10115 10116 $(".menu-item").removeClass("hover"); 10117 $(".menu_top_block.catalog_block li").removeClass("hover"); 10118 $(".bx-breadcrumb-item.drop").removeClass("hover"); 10119 10120 if (_th.hasClass("more") && !_th.hasClass("hover")) { 10121 e.preventDefault(); 10122 e.stopPropagation(); 10123 _th.siblings().removeClass("hover"); 10124 _th.addClass("hover"); 10125 $(".menu.topest").css({ overflow: "visible" }); 10126 } else { 10127 var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href"); 10128 if (href && href !== "undefined") location.href = href; 10129 } 10130 }); 10131 }); 10132 } 10133 } else { 10134 $(selector).off(); 10135 } 10136} 10137 10138function touchLeftMenu(selector) { 10139 if (isMobile) { 10140 if ($(selector).length) { 10141 $(selector).each(function () { 10142 var th = $(this); 10143 th.on("touchend", function (e) { 10144 var _th = $(e.target).closest("li"); 10145 10146 $(".menu-item").removeClass("hover"); 10147 $(".bx-breadcrumb-item.drop").removeClass("hover"); 10148 $(".menu.topest > li").removeClass("hover"); 10149 10150 if (_th.hasClass("has-child") && !_th.hasClass("hover")) { 10151 e.preventDefault(); 10152 e.stopPropagation(); 10153 _th.siblings().removeClass("hover"); 10154 _th.addClass("hover"); 10155 } else { 10156 var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href"); 10157 if (href && href !== "undefined") location.href = href; 10158 } 10159 }); 10160 }); 10161 } 10162 } else { 10163 $(selector).off(); 10164 } 10165} 10166 10167function touchBreadcrumbs(selector) { 10168 if (isMobile) { 10169 if ($(selector).length) { 10170 $(selector).each(function () { 10171 var th = $(this); 10172 th.on("touchend", function (e) { 10173 var _th = $(e.target).closest(".bx-breadcrumb-item"); 10174 10175 $(".menu-item").removeClass("hover"); 10176 $(".menu.topest > li").removeClass("hover"); 10177 $(".menu_top_block.catalog_block li").removeClass("hover"); 10178 10179 if (!_th.hasClass("hover")) { 10180 e.preventDefault(); 10181 e.stopPropagation(); 10182 _th.siblings().removeClass("hover"); 10183 _th.addClass("hover"); 10184 } else { 10185 _th.removeClass("hover"); 10186 var href = $(e.target).attr("href") ? $(e.target).attr("href") : $(e.target).closest("a").attr("href"); 10187 if (href && href !== "undefined") location.href = href; 10188 } 10189 }); 10190 }); 10191 } 10192 } else { 10193 $(selector).off(); 10194 } 10195} 10196 10197function touchItemBlock(selector) {} 10198function touchBasket(selector) { 10199 if (arAsproOptions["THEME"]["SHOW_BASKET_ONADDTOCART"] !== "N") { 10200 if ($(window).outerWidth() > 600) { 10201 $(document) 10202 .find(selector) 10203 .on("touchend", function (e) { 10204 if ($(this).parent().find(".basket_popup_wrapp").length && !$(this).hasClass("hover")) { 10205 e.preventDefault(); 10206 e.stopPropagation(); 10207 $(this).addClass("hover"); 10208 $(this).parent().find(".basket_popup_wrapp").slideDown(); 10209 } 10210 }); 10211 } else { 10212 $(selector).off(); 10213 } 10214 } 10215} 10216 10217function showTotalSummItem(popup) { 10218 //show total summ 10219 if ( 10220 arAsproOptions["THEME"]["SHOW_TOTAL_SUMM_TYPE"] == "ALWAYS" && 10221 arAsproOptions["THEME"]["SHOW_TOTAL_SUMM"] == "Y" 10222 ) { 10223 var parent = "body "; 10224 if (typeof popup === "string" && popup == "Y") parent = ".popup "; 10225 $(parent + ".counter_wrapp .counter_block input.text").each(function () { 10226 var _th = $(this); 10227 if (_th.data("product")) { 10228 var obProduct = _th.data("product"); 10229 if (typeof window[obProduct] == "object") window[obProduct].setPriceAction("Y"); 10230 else setPriceItem(_th.closest(".main_item_wrapper"), _th.val()); 10231 } else setPriceItem(_th.closest(".main_item_wrapper"), _th.val()); 10232 }); 10233 } 10234} 10235 10236function initFull() { 10237 initSelects(document); 10238 initHoverBlock(document); 10239 touchItemBlock(".catalog_item a"); 10240 InitOrderCustom(); 10241 showTotalSummItem(); 10242 basketActions(); 10243 10244 if (typeof orderActions === "function") { 10245 orderActions(); 10246 } 10247 10248 checkMobileRegion(); 10249} 10250 10251checkMobileRegion = function () { 10252 if ($(".confirm_region").length
10252) { 10253 if (!$(".top_mobile_region").length) 10254 $( 10255 '<div class="top_mobile_region"><div class="confirm_wrapper"><div class="confirm_region"></div></div></div>' 10256 ).insertBefore($("#mobileheader")); 10257 $(".top_mobile_region .confirm_region").html($(".confirm_region").html()); 10258 } 10259}; 10260 10261if (!funcDefined("basketActions")) { 10262 basketActions = function () { 10263 if (arAsproOptions["PAGES"]["BASKET_PAGE"]) { 10264 checkMinPrice(); 10265 10266 //remove4Cart 10267 if (typeof BX.Sale !== "undefined" && typeof BX.Sale === "object") { 10268 if (typeof BX.Sale.BasketComponent !== "undefined" && typeof BX.Sale.BasketComponent === "object") { 10269 $(document).on("click", ".basket-item-actions-remove", function () { 10270 var basketID = $(this).closest(".basket-items-list-item-container").data("id"); 10271 if (BX.Sale.BasketComponent.items && BX.Sale.BasketComponent.items[basketID]) { 10272 delFromBasketCounter(BX.Sale.BasketComponent.items[basketID].PRODUCT_ID); 10273 } 10274 }); 10275 } 10276 } 10277 10278 if (location.hash) { 10279 var hash = location.hash.substring(1); 10280 if ($("#basket_toolbar_button_" + hash).length) $("#basket_toolbar_button_" + hash).trigger("click"); 10281 10282 if ($('.basket-items-list-header-filter a[data-filter="' + hash + '"]').length) 10283 $('.basket-items-list-header-filter a[data-filter="' + hash + '"]')[0].click(); 10284 } 10285 var svg_cross = 10286 '<svg xmlns="http://www.w3.org/2000/svg" width="8" height="8" viewBox="0 0 8 8"><path id="Rounded_Rectangle_568_copy_13" data-name="Rounded Rectangle 568 copy 13" class="cls-1" d="M1615.4,589l2.32,2.315a0.987,0.987,0,0,1,0,1.4,1,1,0,0,1-1.41,0L1614,590.4l-2.31,2.315a1,1,0,0,1-1.41,0,0.987,0.987,0,0,1,0-1.4L1612.6,589l-2.32-2.314a0.989,0.989,0,0,1,0-1.4,1,1,0,0,1,1.41,0l2.31,2.315,2.31-2.315a1,1,0,0,1,1.41,0,0.989,0.989,0,0,1,0,1.4Z" transform="translate(-1610 -585)"/></svg>'; 10287 10288 $(".bx_sort_container").append( 10289 '<div class="top_control basket_action"><span style="opacity:0;" class="delete_all colored_theme_hover_text remove_all_basket">' + 10290 svg_cross + 10291 BX.message("BASKET_CLEAR_ALL_BUTTON") + 10292 "</span></div>" 10293 ); 10294 if ($(".basket-items-list-header-filter").length) { 10295 $(".basket-items-list-header-filter").append( 10296 '<div class="top_control basket_action"><span style="opacity:1;" class="delete_all colored_theme_hover_text remove_all_basket">' + 10297 svg_cross + 10298 BX.message("BASKET_CLEAR_ALL_BUTTON") + 10299 "</span></div>" 10300 ); 10301 10302 var cur_index = $(".basket-items-list-header-filter > a.active").index(); 10303 //fix delayed 10304 if (cur_index == 3) cur_index = 2; 10305 10306 if ($(".basket-items-list-header-filter > a.active").data("filter") == "all") cur_index = "all"; 10307 10308 $(".basket-items-list-header-filter .top_control .delete_all").data("type", cur_index); 10309 10310 $(".basket-items-list-header-filter > a").on("click", function () { 10311 var index = $(this).index(); 10312 10313 //fix delayed 10314 if (index == 3) index = 2; 10315 10316 if ($(this).data("filter") == "all") index = "all"; 10317 10318 $(".basket-items-list-header-filter .top_control .delete_all").data("type", index); 10319 }); 10320 } else { 10321 var cur_index = $(".bx_sort_container a.current").index(); 10322 $(".bx_sort_container .top_control .delete_all").data("type", cur_index); 10323 if ($(".bx_ordercart > div:eq(" + cur_index + ") table tbody tr td.item").length) 10324 $(".bx_sort_container .top_control .delete_all").css("opacity", 1); 10325 10326 $(".bx_ordercart .bx_ordercart_coupon #coupon").wrap('<div class="input"></div>'); 10327 10328 $(".bx_sort_container > a").on("click", function () { 10329 var index = $(this).index(); 10330 $(".bx_sort_container .top_control .delete_all").data("type", index); 10331 10332 if ($(".bx_ordercart > div:eq(" + index + ") table tbody tr td.item").length) 10333 $(".bx_sort_container .top_control .delete_all").css("opacity", 1); 10334 else $(".bx_sort_container .top_control .delete_all").css("opacity", 0); 10335 }); 10336 } 10337 10338 $(".basket_print").on("click", function () { 10339 // window.open(location.pathname+"?print=Y",'_blank'); 10340 window.print(); 10341 }); 10342 10343 $(".delete_all").on("click", function () { 10344 if (arAsproOptions["COUNTERS"]["USE_BASKET_GOALS"] !== "N") { 10345 var eventdata = { 10346 goal: "goal_basket_clear", 10347 params: { type: $(this).data("type") }, 10348 }; 10349 BX.onCustomEvent("onCounterGoals", [eventdata]); 10350 } 10351 $.post( 10352 arAsproOptions["SITE_DIR"] + "ajax/action_basket.php", 10353 "TYPE=" + $(this).data("type") + "&CLEAR_ALL=Y", 10354 $.proxy(function (data) { 10355 location.reload(); 10356 }) 10357 ); 10358 }); 10359 10360 $(".bx_item_list_section .bx_catalog_item").sliceHeight({ 10361 row: ".bx_item_list_slide", 10362 item: ".bx_catalog_item", 10363 }); 10364 10365 BX.addCustomEvent("onAjaxSuccess", function (e) { 10366 checkMinPrice(); 10367 10368 var errorText = $.trim($("#warning_message").text()); 10369 $("#basket_items_list .error_text").detach(); 10370 if (errorText != "") { 10371 $("#warning_message").hide().text(""); 10372 $("#basket_items_list").prepend('<div class="error_text">' + errorText + "</div>"); 10373 } 10374 10375 if (typeof e === "object" && e && "BASKET_DATA" in e) { 10376 if ($("#ajax_basket").length) { 10377 reloadTopBasket("add", $("#ajax_basket"), 200, 5000, "Y"); 10378 } 10379 if ($("#basket_line .basket_fly").length) { 10380 basketFly("open", "N"); 10381 } 10382 } 10383 if (checkCounters("google")) { 10384 BX.unbindAll( 10385 BX.Sale.BasketComponent.getEntity( 10386 BX.Sale.BasketComponent.getCacheNode(BX.Sale.BasketComponent.ids.basketRoot), 10387 "basket-checkout-button" 10388 ) 10389 ); 10390 } 10391 }); 10392 if (checkCounters("google")) { 10393 BX.unbindAll( 10394 BX.Sale.BasketComponent.getEntity( 10395 BX.Sale.BasketComponent.getCacheNode(BX.Sale.BasketComponent.ids.basketRoot), 10396 "basket-checkout-button" 10397 ) 10398 ); 10399 } 10400 $(document).on( 10401 "click", 10402 ".bx_ordercart_order_pay_center .checkout, .basket-checkout-section-inner .basket-btn-checkout", 10403 function () { 10404 if (checkCounters("google")) { 10405 const gotoOrder = function () { 10406 BX.Sale.BasketComponent.checkOutAction(); 10407 }; 10408 checkoutCounter(1, "start order", gotoOrder); 10409 } 10410 } 10411 ); 10412 } 10413 }; 10414} 10415 10416if (!funcDefined("checkMinPrice")) { 10417 checkMinPrice = function () { 10418 if (arAsproOptions["PAGES"]["BASKET_PAGE"]) { 10419 var summ_raw = 0, 10420 summ = 0; 10421 if ($("#allSum_FORMATED").length) { 10422 summ_raw = $("#allSum_FORMATED") 10423 .text() 10424 .replace(/[^0-9\.,]/g, ""); 10425 summ = parseFloat(summ_raw); 10426 if ($("#basket_items").length) { 10427 var summ = 0; 10428 $("#basket_items tr").each(function () { 10429 if (typeof $(this).data("item-price") !== "undefined" && $(this).data("item-price")) 10430 summ += 10431 $(this).data("item-price") * 10432 $(this) 10433 .find("#QUANTITY_INPUT_" + $(this).attr("id")) 10434 .val(); 10435 }); 10436 } 10437 if (!$(".catalog_back").length) 10438 $(".bx_ordercart_order_pay_center").prepend( 10439 '<a href="' + 10440 arAsproOptions["PAGES"]["CATALOG_PAGE_URL"] + 10441 '" class="catalog_back btn btn-default btn-lg white grey">' + 10442 BX.message("BASKET_CONTINUE_BUTTON") + 10443 "</a>" 10444 ); 10445 } 10446 10447 if (arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y") 10448 $(".basket-coupon-section").addClass("smallest"); 10449 10450 if (typeof BX.Sale !== "undefined") { 10451 if (typeof BX.Sale.BasketComponent !== "undefined" && typeof BX.Sale.BasketComponent.result !== "undefined") 10452 summ = BX.Sale.BasketComponent.result.allSum; 10453 } 10454 10455 if (arAsproOptions["PRICES"]["MIN_PRICE"]) { 10456 if (arAsproOptions["PRICES"]["MIN_PRICE"] > summ) { 10457 var svgMinPrice = 10458 '<i class="svg svg-inline-price colored_theme_svg" aria-hidden="true"><svg id="Group_278_copy" data-name="Group 278 copy" xmlns="http://www.w3.org/2000/svg" width="38" height="38" viewBox="0 0 38 38"><path id="Ellipse_305_copy_2" data-name="Ellipse 305 copy 2" class="clswm-1" d="M1851,561a19,19,0,1,1,19-19A19,19,0,0,1,1851,561Zm0-36a17,17,0,1,0,17,17A17,17,0,0,0,1851,525Zm3.97,10.375-0.03.266c-0.01.062-.02,0.127-0.03,0.188l-0.94,7.515h0a2.988,2.988,0,0,1-5.94,0H1848l-0.91-7.525c-0.01-.041-0.01-0.086-0.02-0.128l-0.04-.316h0.01c-0.01-.
10458125-0.04-0.246-0.04-0.375a4,4,0,0,1,8,0c0,0.129-.03.25-0.04,0.375h0.01ZM1851,533a2,2,0,0,0-2,2,1.723,1.723,0,0,0,.06.456L1850,543a1,1,0,0,0,2,0l0.94-7.544A1.723,1.723,0,0,0,1853,535,2,2,0,0,0,1851,533Zm0,14a3,3,0,1,1-3,3A3,3,0,0,1,1851,547Zm0,4a1,1,0,1,0-1-1A1,1,0,0,0,1851,551Z" transform="translate(-1832 -523)"></path> <path class="clswm-2 op-cls" d="M1853,543l-1,1h-2l-1-1-1-8,1-2,1-1h2l1,1,1,2Zm-1,5,1,1v2l-1,1h-2l-1-1v-2l1-1h2Z" transform="translate(-1832 -523)"></path></svg></i>'; 10459 if ($(".oneclickbuy.fast_order").length) $(".oneclickbuy.fast_order").remove(); 10460 10461 if ($(".basket-checkout-container").length) { 10462 if (!$(".icon_error_wrapper").length) { 10463 $(".basket-checkout-block.basket-checkout-block-btn").html( 10464 '<div class="icon_error_wrapper"><div class="icon_error_block">' + 10465 svgMinPrice + 10466 BX.message("MIN_ORDER_PRICE_TEXT").replace( 10467 "#PRICE#", 10468 jsPriceFormat(arAsproOptions["PRICES"]["MIN_PRICE"]) 10469 ) + 10470 "</div></div>" 10471 ); 10472 } 10473 } else { 10474 if (!$(".icon_error_wrapper").length && typeof jsPriceFormat !== "undefined") { 10475 $(".bx_ordercart_order_pay_center").prepend( 10476 '<div class="icon_error_wrapper"><div class="icon_error_block">' + 10477 svgMinPrice + 10478 BX.message("MIN_ORDER_PRICE_TEXT").replace( 10479 "#PRICE#", 10480 jsPriceFormat(arAsproOptions["PRICES"]["MIN_PRICE"]) 10481 ) + 10482 "</div></div>" 10483 ); 10484 } 10485 if ($(".bx_ordercart_order_pay .checkout").length) $(".bx_ordercart_order_pay .checkout").remove(); 10486 } 10487 } else { 10488 if ($(".icon_error_wrapper").length) $(".icon_error_wrapper").remove(); 10489 10490 if ($(".basket-checkout-container").length) { 10491 if ( 10492 !$(".oneclickbuy.fast_order").length && 10493 arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y" && 10494 !$(".basket-btn-checkout.disabled").length 10495 ) 10496 $(".basket-checkout-section-inner").append( 10497 '<div class="fastorder"><span class="oneclickbuy btn btn-lg fast_order btn-transparent-border-color" onclick="oneClickBuyBasket()">' + 10498 BX.message("BASKET_QUICK_ORDER_BUTTON") + 10499 "</span></div>" 10500 ); 10501 } else { 10502 if ($(".bx_ordercart_order_pay .checkout").length) 10503 $(".bx_ordercart .bx_ordercart_order_pay .checkout").css("opacity", "1"); 10504 else 10505 $(".bx_ordercart_order_pay_center").append( 10506 '<a href="javascript:void(0)" onclick="checkOut();" class="checkout" style="opacity: 1;">' + 10507 BX.message("BASKET_ORDER_BUTTON") + 10508 "</a>" 10509 ); 10510 if ( 10511 !$(".oneclickbuy.fast_order").length && 10512 arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y" 10513 ) 10514 $(".bx_ordercart_order_pay_center").append( 10515 '<span class="oneclickbuy btn btn-lg fast_order btn-transparent-border-color" onclick="oneClickBuyBasket()">' + 10516 BX.message("BASKET_QUICK_ORDER_BUTTON") + 10517 "</span>" 10518 ); 10519 } 10520 } 10521 } else { 10522 if ($(".basket-checkout-container").length) { 10523 if ( 10524 !$(".oneclickbuy.fast_order").length && 10525 arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y" && 10526 !$(".basket-btn-checkout.disabled").length 10527 ) 10528 $(".basket-checkout-section-inner").append( 10529 '<div class="fastorder"><span class="oneclickbuy btn btn-lg fast_order btn-transparent-border-color" onclick="oneClickBuyBasket()">' + 10530 BX.message("BASKET_QUICK_ORDER_BUTTON") + 10531 "</span></div>" 10532 ); 10533 } else { 10534 $(".bx_ordercart .bx_ordercart_order_pay .checkout").css("opacity", "1"); 10535 if (!$(".oneclickbuy.fast_order").length && arAsproOptions["THEME"]["SHOW_ONECLICKBUY_ON_BASKET_PAGE"] == "Y") 10536 $(".bx_ordercart_order_pay_center").append( 10537 '<span class="oneclickbuy btn btn-lg fast_order btn-trans
10537parent-border-color" onclick="oneClickBuyBasket()">' + 10538 BX.message("BASKET_QUICK_ORDER_BUTTON") + 10539 "</span>" 10540 ); 10541 } 10542 } 10543 10544 showBasketShareBtn(); 10545 showBasketHeadingBtn(); 10546 10547 $("#basket-root .basket-checkout-container .basket-checkout-section .basket-checkout-block .basket-btn-checkout"); 10548 $("#basket-root .basket-checkout-container").addClass("visible"); 10549 } 10550 }; 10551} 10552 10553var isFrameDataReceived = false; 10554if (typeof window.frameCacheVars !== "undefined") { 10555 BX.addCustomEvent(window, "onFrameDataRequestFail", function (response) { 10556 console.log(response); 10557 }); 10558 10559 BX.addCustomEvent("onFrameDataReceivedBefore", function () { 10560 // stop ya metrika webvisor DOM indexer 10561 pauseYmObserver(); 10562 }); 10563 10564 BX.addCustomEvent("onFrameDataReceived", function (json) { 10565 initFull(); 10566 10567 CheckTopMenuDotted(); 10568 10569 checkLinkedArticles(); 10570 checkLinkedBlocks(".linked-banners-list"); 10571 10572 if ($(".logo-row.v2").length) { 10573 $(window).resize(); // need to check resize flexslider & menu 10574 setTimeout(function () { 10575 CheckTopMenuDotted(); 10576 }, 100); 10577 } 10578 10579 if (funcDefined("setNewHeader")) { 10580 if (typeof BX === "object" && (BX.message("TYPE_SKU") != "TYPE_1" || BX.message("HAS_SKU_PROPS") != "Y")) { 10581 setNewHeader(); 10582 } else { 10583 var objNameWrapper = $(".bx_catalog_item_scu[id]"); 10584 if (objNameWrapper.length) { 10585 var id = "ob" + objNameWrapper.attr("id").replace("_skudiv", ""); 10586 if (id && window[id] !== undefined) { 10587 var obj = window[id].offers[window[id].offerNum]; 10588 if (obj !== undefined) { 10589 setNewHeader(obj); 10590 } 10591 } 10592 } 10593 } 10594 } 10595 10596 typeof InitAppear === 'function' && InitAppear(); 10597 10598 // resume ya metrika webvisor 10599 // (100ms sliceHeight) + (200ms mCustomScroll) + (100ms lazyload) 10600 setTimeout(resumeYmObserver, 400); 10601 10602 isFrameDataReceived = true; 10603 }); 10604} else { 10605 $(document).ready(initFull); 10606} 10607 10608if (!funcDefined("setHeightBlockSlider")) { 10609 setHeightBlockSlider = function () { 10610 /*$(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").equalize({ children: ".item-title" }); 10611 $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").equalize({ children: ".item_info" }); 10612 $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").equalize({ children: ".catalog_item" }); 10613 10614 var sliderWidth = $(document).find(".specials.tab_slider_wrapp").outerWidth(); 10615 10616 var iCountTabs = $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").length; 10617 10618 if (iCountTabs <= 1) { 10619 $(document).find(".specials.tab_slider_wrapp .tabs_content > li.cur").css("height", ""); 10620 10621 var itemsButtonsHeight = 0; 10622 if ($(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button").length) { 10623 $(document) 10624 .find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button") 10625 .css("height", "auto"); 10626 itemsButtonsHeight = $(document) 10627 .find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button") 10628 .height(); 10629 $(document) 10630 .find(".specials.tab_slider_wrapp .tabs_content .tab.cur .tabs_slider li .footer_button") 10631 .css("height", ""); 10632 } 10633 var tabsContentUnhover = $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur").height() * 1; 10634 var tabsContentHover = tabsContentUnhover + itemsButtonsHeight + 50; 10635 $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur").attr("data-unhover", tabsContentUnhover); 10636 $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur").attr("data-hover", tabsContentHover); 10637 $(document).find(".specials.tab_slider_wrapp .tabs_content").height(tabsContentUnhover); 10638 $(document).find(".specials.tab_slider_wrapp .tabs_content .tab.cur .flex-viewport").height(tabsContentUnhover); 10639 } else { 10640 $(document) 10641 .find(".specials.tab_slider_wrapp .tabs_content > li.cur") 10642 .each(function () { 10643 var _th = $(this); 10644 _th.css("height", ""); 10645 10646 var itemsButtonsHeight = 0; 10647 if (_th.find(".tabs_slider li .footer_button").length) { 10648 _th.find(".tabs_slider li .footer_button").css("height", "auto"); 10649 itemsButtonsHeight = _th.find(".tabs_slider li .footer_button").height(); 10650 _th.find(".tabs_slider li .footer_button").css("height", ""); 10651 } 10652 10653 var tabsContentUnhover = _th.height() * 1; 10654 var tabsContentHover = tabsContentUnhover + itemsButtonsHeight + 50; 10655 _th.attr("data-unhover", tabsContentUnhover); 10656 _th.attr("data-hover", tabsContentHover); 10657 _th.parent().height(tabsContentUnhover); 10658 _th.find(".flex-viewport").height(tabsContentUnhover); 10659 }); 10660 }*/ 10661 }; 10662} 10663 10664if (!funcDefined("checkTopFilter")) { 10665 checkTopFilter = function () {}; 10666} 10667 10668if (!funcDefined("checkStickyFooter")) { 10669 checkStickyFooter = function () {}; 10670} 10671 10672if (!funcDefined("checkLinkedArticles")) { 10673 checkLinkedArticles = function () { 10674 try { 10675 if ($(".linked-blog-list.content .item-views").length) { 10676 var mobileRow = $(".linked-blog-list").data("mobile_row"), 10677 desktopRow = $(".linked-blog-list").data("desktop_row"), 10678 parentBlock = $(".ajax_load .js_append"), 10679 widthRow = parentBlock.getFloatWidth(), 10680 elementWidthRow = parentBlock.find("> .item:eq(0)").getFloatWidth(), 10681 elementsCount = parentBlock.find("> .item").length, 10682 slice = Math.floor(widthRow / elementWidthRow), 10683 rowInsertCount = Math.floor(elementsCount / slice), 10684 bCalculateRows = false;
10685 if (window.matchMedia("(max-width: 767px)").matches) { 10686 if (!mobileRow && desktopRow) { 10687 mobileRow = desktopRow; 10688 } 10689 if (mobileRow && mobileRow <= rowInsertCount) { 10690 rowInsertCount = slice * mobileRow; 10691 bCalculateRows = true; 10692 } 10693 } else { 10694 if (desktopRow && desktopRow <= rowInsertCount) { 10695 rowInsertCount = slice * desktopRow; 10696 bCalculateRows = true; 10697 } 10698 } 10699 if (!bCalculateRows) { 10700 rowInsertCount = elementsCount; 10701 } 10702 10703 var linkedBlock = ".linked-blog-list"; 10704 var blockInItems = parentBlock.find(linkedBlock); 10705 if (blockInItems.length) { 10706 $(blockInItems).insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")")); 10707 setTimeout(function () { 10708 $(blockInItems).addClass("visible"); 10709 }, 0); 10710 } else { 10711 var cloneBlock = $(linkedBlock).clone(); 10712 var owlBlock = cloneBlock.find(".owl-carousel-wait"); 10713 cloneBlock.insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")")); 10714 owlBlock.removeClass("owl-carousel-wait").addClass("swiper"); 10715 setTimeout(function () { 10716 cloneBlock.addClass("visible"); 10717 initSwiperSlider(); 10718 owlBlock.removeClass("loader_circle"); 10719 }, 1); 10720 } 10721 } 10722 } catch (e) { 10723 console.error(e); 10724 } 10725 }; 10726} 10727 10728if (!funcDefined("checkLinkedBlocks")) { 10729 checkLinkedBlocks = function (linkedBlock) { 10730 if (!linkedBlock) linkedBlock = ".linked-banners-list"; 10731 10732 try { 10733 if ($(linkedBlock + ".content" + " div").length) { 10734 var mobileRow = $(linkedBlock).data("mobile_row"), 10735 desktopRow = $(linkedBlock).data("desktop_row"), 10736 wrapperBlock = $(".ajax_load .js_wrapper_items"), 10737 parentBlock = $(".ajax_load .js_append"), 10738 widthRow = wrapperBlock.getFloatWidth(), 10739 elementWidthRow = parentBlock.find("> .item:eq(0)").getFloatWidth(), 10740 elementsCount = parentBlock.find("> .item").length, 10741 slice = Math.floor(widthRow / elementWidthRow), 10742 rowInsertCount = Math.floor(elementsCount / slice), 10743 bCalculateRows = false; 10744 if (window.matchMedia("(max-width: 767px)").matches) { 10745 if (!mobileRow && desktopRow) { 10746 mobileRow = desktopRow; 10747 } 10748 if (mobileRow && mobileRow <= rowInsertCount) { 10749 rowInsertCount = slice * mobileRow; 10750 bCalculateRows = true; 10751 } 10752 } else { 10753 if (desktopRow && desktopRow <= rowInsertCount) { 10754 rowInsertCount = slice * desktopRow; 10755 bCalculateRows = true; 10756 } 10757 } 10758 if (!bCalculateRows) { 10759 rowInsertCount = elementsCount; 10760 } 10761 var blockInItems = parentBlock.find(linkedBlock); 10762 if (blockInItems.length) { 10763 $(blockInItems).insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")")); 10764 setTimeout(function () { 10765 $(blockInItems).addClass("visible"); 10766 }, 0); 10767 } else { 10768 var cloneBlock = $(linkedBlock).clone(); 10769 var owlBlock = cloneBlock.find(".owl-carousel-wait"); 10770 cloneBlock.insertAfter(parentBlock.find("> .item:eq(" + (rowInsertCount - 1) + ")")); 10771 owlBlock.removeClass("owl-carousel-wait").addClass("swiper"); 10772 setTimeout(function () { 10773 cloneBlock.addClass("visible"); 10774 initSwiperSlider(); 10775 owlBlock.removeClass("loader_circle"); 10776 }, 1); 10777 } 10778 } 10779 } catch (e) { 10780 console.error(e); 10781 } 10782 }; 10783} 10784 10785/* EVENTS */ 10786var timerResize = false, 10787 ignoreResize = []; 10788$(window).resize(function () { 10789 checkLinkedArticles(); 10790 checkLinkedBlocks(".linked-banners-list"); 10791 10792 // here immediate functions 10793 if (!ignoreResize.length) { 10794 if (timerResize) { 10795 clearTimeout(timerResize); 10796 timerResize = false; 10797 } 10798 timerResize = setTimeout(function () { 10799 // here delayed functions in event 10800 BX.onCustomEvent("onWindowResize", false); 10801 }, 50); 10802 } 10803}); 10804 10805var timerScroll = false, 10806 ignoreScroll = [], 10807 documentScrollTopLast = window.pageYOffset, 10808 startScroll = 0; 10809$(window).scroll(function () { 10810 // here immediate functions 10811 documentScrollTopLast = window.pageYOffset; 10812 SetFixedAskBlock(); 10813 10814 if (!ignoreScroll.length) { 10815 if (timerScroll) { 10816 clearTimeout(timerScroll); 10817 timerScroll = false;
10818 } 10819 timerScroll = setTimeout(function () { 10820 // here delayed functions in event 10821 BX.onCustomEvent("onWindowScroll", false); 10822 }, 50); 10823 } 10824}); 10825 10826BX.addCustomEvent("onWindowResize", function (eventdata) { 10827 try { 10828 ignoreResize.push(true); 10829 10830 CheckTabActive(); 10831 CheckTopMenuFullCatalogSubmenu(); 10832 10833 if (window.matchMedia("(min-width:768px)").matches) { 10834 closeYandexMap(); 10835 } 10836 10837 if ($("nav.mega-menu.sliced").length) $("nav.mega-menu.sliced").removeClass("initied"); 10838 CheckTopMenuDotted(); 10839 10840 CheckTopVisibleMenu(); 10841 10842 checkScrollToTop(); 10843 CheckObjectsSizes(); 10844 10845 initSly(); 10846 10847 // checkVerticalMobileFilter(); 10848 if (typeof checkMobilePhone === "function") { 10849 checkMobilePhone(); 10850 } 10851 checkTopFilter(); 10852 if (typeof checkMobileFilter === "function") { 10853 checkMobileFilter(); 10854 } 10855 10856 if (typeof window["stickySidebar"] !== "undefined") { 10857 if (window.matchMedia("(max-width: 991px)").matches) { 10858 window["stickySidebar"].destroy(); 10859 } else { 10860 window["stickySidebar"].bindEvents(); 10861 } 10862 } 10863 10864 if ($(".flexslider.wsmooth").length) { 10865 $(".flexslider.wsmooth").each(function () { 10866 $(this).data("flexslider").smoothHeight(); 10867 }); 10868 } 10869 10870 if (window.matchMedia("(min-width: 767px)").matches) $(".wrapper_middle_menu.wrap_menu").removeClass("mobile"); 10871 10872 if (window.matchMedia("(max-width: 767px)").matches) $(".wrapper_middle_menu.wrap_menu").addClass("mobile"); 10873 10874 if ($("#basket_form").length && $(window).outerWidth() <= 600) { 10875 $("#basket_form .tabs_content.basket > li.cur td").each(function () { 10876 $(this).css("width", ""); 10877 }); 10878 } 10879 10880 $(".bx_filter_section .bx_filter_select_container").each(function () { 10881 var prop_id = $(this).closest(".bx_filter_parameters_box").attr("property_id"); 10882 if ($("#smartFilterDropDown" + prop_id).length) { 10883 $("#smartFilterDropDown" + prop_id).css("max-width", $(this).width()); 10884 } 10885 }); 10886 } catch (e) { 10887 console.log(e); 10888 } finally { 10889 ignoreResize.pop(); 10890 } 10891}); 10892 10893BX.addCustomEvent("onWindowScroll", function (eventdata) { 10894 try { 10895 ignoreScroll.push(true); 10896 } catch (e) { 10897 } finally { 10898 ignoreScroll.pop(); 10899 } 10900}); 10901 10902BX.addCustomEvent("onSlideInit", function (eventdata) { 10903 try { 10904 ignoreResize.push(true); 10905 if (eventdata) { 10906 var slider = eventdata.slider; 10907 if (slider) { 10908 if (slider.hasClass("small-gallery")) $(window).resize(); 10909 // add classes .curent & .shown to slide 10910 slider.find(".item").removeClass("current"); 10911 var curSlide = slider.find(".item.flex-active-slide"), 10912 curSlideId = curSlide.attr("id"), 10913 nav = slider.find(".flex-direction-nav"); 10914 10915 curSlide.addClass("current"); 10916 10917 slider.find(".visible").css("opacity", "1"); 10918 slider.find(".height0").css("height", "auto"); 10919 10920 if (curSlide.hasClass("shown")) { 10921 slider.find(".item.clone[id=" + curSlideId + "_clone]").addClass("shown"); 10922 } 10923 10924 curSlide.addClass("shown"); 10925 } 10926 } 10927 } catch (e) { 10928 } finally { 10929 ignoreResize.pop(); 10930 } 10931}); 10932 10933BX.addCustomEvent("onCounterGoals", function (eventdata) { 10934 if (arAsproOptions["THEME"]["YA_GOALS"] == "Y" && arAsproOptions["THEME"]["YA_COUNTER_ID"]) { 10935 var idCounter = arAsproOptions["THEME"]["YA_COUNTER_ID"]; 10936 idCounter = parseInt(idCounter); 10937 10938 if (typeof eventdata != "object") eventdata = { goal: "undefined" }; 10939 10940 if (typeof eventdata.goal != "string") eventdata.goal = "undefined"; 10941 10942 if (idCounter) { 10943 try { 10944 waitCounter(idCounter, 50, function () { 10945 var obCounter = window["yaCounter" + idCounter]; 10946 if (typeof obCounter == "object") { 10947 obCounter.reachGoal(eventdata.goal); 10948 } 10949 }); 10950 } catch (e) { 10951 console.error(e); 10952 } 10953 } else { 10954 console.info("Bad counter id!", idCounter); 10955 } 10956 } 10957}); 10958 10959$(document).on("click", ".catalog_reviews_extended span.dropdown-select__list-link", function () { 10960 var _this = $(this); 10961 var ajaxData = _this.data("review_sort_ajax"); 10962 var container = _this.closest(".blog-comments"); 10963 containerId = container.attr("id"); 10964 if (containerId !== undefined && containerId) { 10965 ajaxData.containerId = containerId; 10966 } 10967 if (ajaxData !== undefined) { 10968 container.addClass("blur"); 10969 $.ajax({ 10970 type: "post", 10971 data: ajaxData, 10972 success: function (html) { 10973 $("#reviews_sort_continer").html(html); 10974 container.removeClass("blur"); 10975 }, 10976 }); 10977 } 10978}); 10979 10980$(document).on("change", ".filter-panel__sort-form input", function () { 10981 const _this = $(this); 10982 const $form = _this.closest("form")[0]; 10983 const $container = _this.closest(".blog-comments"); 10984 const method = $form.method; 10985 const formData = new FormData($form); 10986 10987 if ($container.length) { 10988 $container.addClass("blur"); 10989 formData.append("containerId", $container.attr("id")); 10990 } 10991 10992 $.ajax({ 10993 data: formData, 10994 type: method, 10995 processData: false, 10996 contentType: false, 10997 success: function (html) { 10998 $("#reviews_sort_continer").html(html); 10999 $container.removeClass("blur"); 11000 }, 11001 }); 11002}); 11003 11004$(document).on("click", ".rating_vote:not(.disable)", function () { 11005 var _this = $(this); 11006 var action = _this.data("action"); 11007 var parent = _this.closest(".rating-vote"); 11008 var commentId = parent.data("comment_id"); 11009 var userId = parent.data("user_id"); 11010 var ajaxUrl = parent.data("ajax_url"); 11011 $.ajax({ 11012 url: ajaxUrl, 11013 dataType: "json", 11014 data: { commentId: commentId, action: action, userId: userId }, 11015 success: function (data) { 11016 if (data.LIKE !== undefined) { 11017 _this.siblings(".rating-vote-result.like").text(data.LIKE); 11018 } 11019 if (data.DISLIKE !== undefined) { 11020 _this.siblings(".rating-vote-result.dislike").text(data.DISLIKE); 11021 } 11022 if (data.SET_ACTIVE_LIKE !== undefined) { 11023 parent.find(".rating_vote.plus").toggleClass("active"); 11024 } 11025 if (data.SET_ACTIVE_DISLIKE !== undefined) { 11026 parent.find(".rating_vote.minus").toggleClass("active"); 11027 } 11028 }, 11029 }); 11030}); 11031 11032function fileInputInit(message, reviews = "N") { 11033 $('input[type=file]:not(".uniform-ignore")').uniform({ 11034 fileButtonHtml: BX.message("JS_FILE_BUTTON_NAME"), 11035 fileDefaultHtml: message, 11036 }); 11037 $(document).on("change", "input[type=file]", function () { 11038 if ($(this).val()) { 11039 $(this).closest(".uploader").addClass("files_add"); 11040 } else { 11041 $(this).closest(".uploader").removeClass("files_add"); 11042 } 11043 }); 11044 $(".form .add_file").on("click", function () { 11045 var index = $(this).closest(".form-group").find("input[type=file]").length; 11046 let inputFormGroup = $(this).closest(".form-group").find(".input"); 11047 if (reviews === "Y") { 11048 inputFormGroup.append( 11049 '<input type="file" class="form-control" tabindex="3" id="comment_images" name="comment_images[]" value="" />' 11050 ); 11051 } else { 11052 inputFormGroup.append( 11053 '<input type="file" id="POPUP_FILE' + index + '" name="FILE_n' + index + '" class="inputfile" value="" />'
11054 ); 11055 } 11056 11057 $('input[type=file]:not(".uniform-ignore")').uniform({ 11058 fileButtonHtml: BX.message("JS_FILE_BUTTON_NAME"), 11059 fileDefaultHtml: message, 11060 }); 11061 }); 11062} 11063 11064function declOfNum(number, titles) { 11065 var cases = [2, 0, 1, 1, 1, 2]; 11066 return number + " " + titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[Math.min(number % 10, 5)]]; 11067} 11068 11069function array_values_js(input) { 11070 var tmp_arr = new Array(), 11071 cnt = 0; 11072 for (key in input) { 11073 tmp_arr[cnt] = input[key]; 11074 cnt++; 11075 } 11076 11077 return tmp_arr; 11078} 11079 11080$(document).on("input", ".bx_filter_parameters_box_container input[type=text], .inputdecimal", function () { 11081 this.value = this.value.replace(/[^\d\.\-]/g, ""); 11082}); 11083 11084/* End */ 11085; 11086; /* Start:"a:4:{s:4:"full";s:62:"/bitrix/templates/aspro_max/js/blocks/blocks.js?17507629956818";s:6:"source";s:47:"/bitrix/templates/aspro_max/js/blocks/blocks.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 11087InitMenuNavigationAim = function () { 11088 var $block = $(".menu-navigation__sections-wrapper .menu-navigation__sections:not(.aim-init)"); 11089 if ($block.length) { 11090 $block.addClass("aim-init"); 11091 loadScripts(arAsproOptions["SITE_TEMPLATE_PATH"] + "/vendor/js/jquery.menu-aim.js", function () { 11092 $block.menuAim({ 11093 firstActiveRow: true, 11094 rowSelector: "> .menu-navigation__sections-item", 11095 activate: function activate(a) {
11096 var _this = $(a), 11097 index = _this.index(), 11098 items = _this.closest(".menu-navigation__sections-wrapper").next(), 11099 link = _this.find("> a"); 11100 11101 _this.siblings().find("> a").addClass("dark_link"); 11102 link.addClass("colored_theme_text").removeClass("dark_link"); 11103 items.find(".parent-items").siblings().hide(); 11104 items.find(".parent-items").eq(index).show(); 11105 }, 11106 deactivate: function deactivate(a) { 11107 var _this = $(a), 11108 index = _this.index(), 11109 items = _this.closest(".menu-navigation__sections-wrapper").next(), 11110 link = _this.find("> a"); 11111 11112 link.removeClass("colored_theme_text").addClass("dark_link"); 11113 items.find(".parent-items").siblings().hide(); 11114 }, 11115 }); 11116 }); 11117 } 11118}; 11119 11120readyDOM(function () { 11121 window.asproAllProgressBar = document.querySelectorAll(".header-progress-bar__inner"); 11122}); 11123 11124/*progress bar in header*/ 11125function updateProgressBar() { 11126 let allProgressBar = typeofExt(window.asproAllProgressBar) === "nodelist" ? window.asproAllProgressBar : false; 11127 if (allProgressBar && allProgressBar.length) { 11128 let scrollHeight = Math.max( 11129 document.body.scrollHeight, 11130 document.documentElement.scrollHeight, 11131 document.body.offsetHeight, 11132 document.documentElement.offsetHeight, 11133 document.body.clientHeight, 11134 document.documentElement.clientHeight 11135 ); 11136 let scrollTop = window.pageYOffset || document.documentElement.scrollTop; 11137 let clientHeight = document.documentElement.clientHeight; 11138 let scrollProcent = Math.round((scrollTop / (scrollHeight - clientHeight)) * 100); 11139 if (allProgressBar.length) { 11140 for (let item = 0; item < allProgressBar.length; item++) { 11141 allProgressBar[item].style.width = scrollProcent + "%"; 11142 } 11143 } 11144 } 11145} 11146/**/ 11147 11148$(document).ready(function () { 11149 //dropdown-select 11150 $(document).on("click", ".dropdown-select .dropdown-select__title", function () { 11151 var _this = $(this), 11152 menu = _this.parent().find("> .dropdown-select__list"); 11153 11154 BX.onCustomEvent("onCloseDropDown"); 11155 11156 _this.toggleClass("dropdown-select__title--opened", menu.is(":hidden")); 11157 menu.stop().slideToggle(); 11158 }); 11159 11160 // close select 11161 $("html, body").on("mousedown", function (e) { 11162 if (e.target.className.toString().indexOf("adm") < 0) { 11163 e.stopPropagation(); 11164 if (!$(e.target).closest(".dropdown-select").length) { 11165 BX.onCustomEvent("onCloseDropDown"); 11166 } 11167 } 11168 }); 11169 11170 BX.addCustomEvent("onCloseDropDown", function () { 11171 $(".dropdown-select .dropdown-select__title").removeClass("dropdown-select__title--opened"); 11172 $(".dropdown-select__list:visible").stop().slideUp(); 11173 }); 11174 /**/ 11175 11176 /*side head block*/ 11177 $(document).on("click", ".slide-block .slide-block__head", function (e) { 11178 var _this = $(this), 11179 menu = _this.siblings(".slide-block__body"), 11180 bVisibleMeu = menu.is(":visible"), 11181 animate = bVisibleMeu ? "slideUp" : "slideDown"; 11182 11183 if (!_this.hasClass("clicked") && menu.length && !_this.hasClass("ignore") && !$(e.target).attr("href")) { 11184 var type = _this.data("id"); 11185 _this.addClass("clicked"); 11186 11187 if (bVisibleMeu) $.cookie(type + "_CLOSED", "Y"); 11188 else $.removeCookie(type + "_CLOSED"); 11189 11190 menu.stop().slideToggle({ 11191 duration: 150, 11192 start: function () { 11193 _this.toggleClass("closed"); 11194 }, 11195 complete: function () { 11196 _this.removeClass("clicked"); 11197 11198 if (typeof window["stickySidebar"] !== "undefined") { 11199 window["stickySidebar"].updateSticky(); 11200 } 11201 }, 11202 }); 11203 } 11204 }); 11205 /**/ 11206 11207 /**/ 11208 $(".switch-item-block .switch-item-block__icons").on("click", function () { 11209 var $this = $(this), 11210 animationTime = 200; 11211 11212 if ($this.hasClass("switch-item-block__icons--small") && !$this.hasClass("active")) { 11213 $this.addClass("active"); 11214 $this.siblings(".switch-item-block__icons--big").removeClass("active"); 11215 $this 11216 .closest(".switch-item-block") 11217 .find(".switch-item-block__count-wrapper--big") 11218 .fadeOut(animationTime, function () { 11219 $this.closest(".switch-item-block").find(".switch-item-block__count-wrapper--small").fadeIn(animationTime); 11220 }); 11221 11222 $this 11223 .closest(".switch-item-block") 11224 .siblings(".big-gallery-block") 11225 .fadeOut(animationTime, function () { 11226 $this.closest(".switch-item-block").siblings(".small-gallery-block").fadeIn(animationTime); 11227 }); 11228 } else if ($this.hasClass("switch-item-block__icons--big") && !$this.hasClass("active")) { 11229 $this.addClass("active"); 11230 $this.siblings(".switch-item-block__icons--small").removeClass("active"); 11231 $this 11232 .closest(".switch-item-block") 11233 .find(".switch-item-block__count-wrapper--small") 11234 .fadeOut(animationTime, function () { 11235 $this.closest(".switch-item-block").find(".switch-item-block__count-wrapper--big").fadeIn(animationTime); 11236 }); 11237 11238 $this 11239 .closest(".switch-item-block") 11240 .siblings(".small-gallery-block") 11241 .fadeOut(animationTime, function () { 11242 $this.closest(".switch-item-block").siblings(".big-gallery-block").fadeIn(animationTime); 11243 }); 11244 } 11245 setTimeout(function () { 11246 InitLazyLoad(); 11247 }, 300); 11248 }); 11249 /**/ 11250 11251 /*many items menu*/ 11252 11253 // InitMenuNavigationAim(); 11254 /**/ 11255 11256 /*progress bar in header*/ 11257 window.addEventListener("scroll", throttle(updateProgressBar, 200)); 11258 /**/ 11259 11260 /*show password*/ 11261 $(".form-control:not(.eye-password-ignore) [type=password]").each(function (item) { 11262 let passBlock = $(this).closest(".form-control"); 11263 let labelBlock = passBlock.find(".label_block"); 11264 if (labelBlock.length) { 11265 labelBlock.addClass("eye-password"); 11266 } else { 11267 passBlock.addClass("eye-password"); 11268 } 11269 }); 11270 $(document).on("click", ".eye-password:not(.eye-password-ignore)", function (event) { 11271 let input = this.querySelector("input"); 11272 let eyeWidth = 56; 11273 if (this.clientWidth - eyeWidth < event.offsetX) { 11274 if (input.type == "password") { 11275 input.type = "text"; 11276 this.classList.add("password-show"); 11277 } else if (input.type == "text") { 11278 input.type = "password"; 11279 this.classList.remove("password-show"); 11280 } 11281 } 11282 }); 11283 /**/ 11284}); 11285 11286/* End */ 11287; 11288; /* Start:"a:4:{s:4:"full";s:57:"/bitrix/templates/aspro_max/js/logo.min.js?17507629773490";s:6:"source";s:42:"/bitrix/templates/aspro_max/js/logo.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 11289if(void 0===window.JLogo){let readyFunc;window.JLogo=function(node,params){var _private={inited:!1};Object.defineProperties(this,{inited:{get:function(){return _private.inited},set:function(value){value&&(_private.inited=!0)}},node:{get:function(){return node}},img:{get:function(){return node?node.querySelector("img"):null}},svg:{get:function(){return node?node.querySelector("svg"):null}}}),this.params=function(key){if("object"==typeof params&&void 0!==key&&Object.keys(params).indexOf(key)>-1)return params[key]},this.init()},window.JLogo.prototype={get src(){return this.img?this.img.getAttribute("src"):""},set src(value){this.img&&this.img.setAttribute("src",value)}
11289,get srcDark(){return arAsproOptions.THEME.LOGO_IMAGE},get srcLight(){return arAsproOptions.THEME.LOGO_IMAGE_LIGHT?arAsproOptions.THEME.LOGO_IMAGE_LIGHT:arAsproOptions.THEME.LOGO_IMAGE},get srcFixed(){return arAsproOptions.THEME.LOGO_IMAGE_FIXED},get color(){if(this.img){let src=this.src;return src===this.srcDark?"dark":src===this.srcLight?"light":""}return""},set color(value){this.canChangeColor&&this.color!==value&&(this.src="light"===value?this.srcLight:this.srcDark)},get isMainLogo(){return Boolean(this.node.closest("header"))},get isFixedLogo(){return Boolean(this.node.closest("#headerfixed"))},get canChangeColor(){let result=!1;if(this.img)if(this.isMainLogo)this.node.closest(".long_banner")||this.node.closest(".long_banner_contents")||(result=!0);else if(this.isFixedLogo){if(!this.srcFixed)return!0}else result=!0;return result},setColorOfBanner:function(banner){this.img&&banner&&void 0!==window.headerLogo&&(value=BX.data(banner,"text_color"),value=value||"dark",this.color!==value&&(this.src="light"===value?this.srcLight:this.srcDark))},get isPreferColor(){return BX.hasClass(document.body,"theme-default")},get preferColor(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"},get themeColor(){return this.isPreferColor?this.preferColor:BX.hasClass(document.body,"theme-dark")?"dark":"light"},init:function(){this.inited||(this.inited=!0,this.img&&(this.color=this.getInvertedColor(this.themeColor),this.bindEvents()))},getInvertedColor:function(value){return"default"===value&&(value=this.preferColor),"light"===value?"dark":"dark"===value?"light":""},bindEvents:function(){"function"==typeof this.handlers.onChangePrefersColorScheme&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",BX.proxy(this.handlers.onChangePrefersColorScheme,this)),"function"==typeof this.handlers.onChangeThemeColor&&BX.addCustomEvent("onChangeThemeColor",BX.proxy(this.handlers.onChangeThemeColor,this))},unbindEvents:function(){},handlers:{onChangePrefersColorScheme:function(event){event||(event=window.event);let newColor=event.matches?"dark":"light";this.isPreferColor&&(this.color=this.getInvertedColor(newColor)),BX.setCookie("prefers-color-scheme",newColor)},onChangeThemeColor:function(eventdata){"object"==typeof eventdata&&eventdata&&"value"in eventdata&&(this.color=this.getInvertedColor(eventdata.value))}}},("function"==typeof readyDOM?readyDOM:BX.ready)((function(){window.headerLogo=new JLogo(document.querySelector("header .logo")),window.headerfixedLogo=new JLogo(document.querySelector("#headerfixed .logo")),window.megamenuLogo=new JLogo(document.querySelector(".mega_fixed_menu .logo")),window.mobileheaderLogo=new JLogo(document.querySelector("#mobileheader .logo")),BX.setCookie("prefers-color-scheme",window.headerLogo.preferColor)}))} 11290/* End */ 11291; 11292; /* Start:"a:4:{s:4:"full";s:74:"/bitrix/templates/aspro_max/js/autoload/dropdown-product.js?17507630011625";s:6:"source";s:59:"/bitrix/templates/aspro_max/js/autoload/dropdown-product.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 11293/*hover top products*/ 11294$(document).on("mouseenter", ".basket-link:not(.basket):not(.counter-state--empty)", function () { 11295 if (window.matchMedia("(min-width: 992px)").matches) { 11296 const _this = $(this); 11297 const $wrapper = _this.parent(); 11298 11299 let $hover_block = $wrapper.find(".basket_hover_block"); 11300 let type = _this.hasClass("compare") ? "compare" : "favorite"; 11301 let obParams = { 11302 type: type, 11303 }; 11304 11305 if (!$hover_block.length) { 11306 $hover_block = $( 11307 '<div class="basket_hover_block loading_block1 loading_block_content1 dropdown-' + type + '"></div>' 11308 ); 11309 $hover_block.appendTo($wrapper); 11310 } 11311 11312 if (!$hover_block.hasClass("loaded")) { 11313 BX.ajax 11314 .runAction("aspro:max.DropdownProducts.show", { 11315 data: { 11316 params: obParams, 11317 }, 11318 }) 11319 .then( 11320 (response) => { 11321 $hover_block.addClass("loaded"); 11322 $hover_block.html(response.data.html); 11323 }, 11324 (response) => { 11325 console.log("error"); 11326 } 11327 ); 11328 } 11329 } 11330}); 11331 11332$(document).on("click", ".dropdown-product__items .remove-cell", function () { 11333 let _this = $(this); 11334 let itemAction = JItemAction.factory(this); 11335 itemAction.state = false;
11336 11337 _this.css("pointer-events", "none"); 11338 11339 _this.closest(".dropdown-product__item").fadeOut(400, function () { 11340 let parentWrap = _this.closest(".basket_hover_block"); 11341 let visibleItems = parentWrap.find(".dropdown-product__item:visible"); 11342 11343 $(this).remove(); 11344 if (!visibleItems.length) { 11345 parentWrap.html(""); 11346 } 11347 }); 11348 itemAction.updateState(); 11349}); 11350/**/ 11351 11352/* End */ 11353; 11354; /* Start:"a:4:{s:4:"full";s:70:"/bitrix/templates/aspro_max/js/autoload/item-action.js?175076300120332";s:6:"source";s:54:"/bitrix/templates/aspro_max/js/autoload/item-action.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 11355if (typeof window.JItemAction === "undefined") { 11356 // class JItemAction 11357 JItemAction = function (node, config) { 11358 node = typeof node === "object" && node && node instanceof Node ? node : null; 11359 config = typeof config === "object" && config ? config : {}; 11360 11361 this.node = node; 11362 11363 var _private = { 11364 inited: false, 11365 data: null, 11366 config: { 11367 bindEvents: true, 11368 changeState: true, 11369 fireGoals: true, 11370 }, 11371 }; 11372 11373 let _config = Object.assign({}, _private.config, config); 11374 11375 Object.defineProperties(this, { 11376 inited: { 11377 get: function () { 11378 return _private.inited; 11379 }, 11380 set: function (value) { 11381 if (value) { 11382 _private.inited = true; 11383 } 11384 }, 11385 }, 11386 11387 config: { 11388 get: function () { 11389 return _config; 11390 }, 11391 }, 11392 11393 data: { 11394 get: function () { 11395 let data = null; 11396 11397 if (this.valid) { 11398 data = this.node.dataset; 11399 } 11400 11401 if (_private.data) { 11402 data = _private.data; 11403 } 11404 11405 return Object.assign({}, data); 11406 }, 11407 set: function (data) { 11408 _private.data = data; 11409 }, 11410 }, 11411 }); 11412 11413 this.init(); 11414 }; 11415 11416 JItemAction.prototype = { 11417 constructor: JItemAction, 11418 busy: false, 11419 parentNode: null, 11420 prevState: null, 11421 activeClass: "added in", 11422 11423 get class() { 11424 return this.constructor.name; 11425 }, 11426 11427 get action() { 11428 return ""; 11429 }, 11430 11431 get requestUrl() { 11432 return `aspro:max.ItemAction.${this.action}`; 11433 }, 11434 11435 get valid() { 11436 return this.node && this.action; 11437 }, 11438 11439 get state() { 11440 if (!this.config.changeState) { 11441 return true; 11442 } 11443 return this.valid && BX.hasClass(this.node, this.activeClass); 11444 }, 11445 11446 set state(value) { 11447 if (this.valid && this.config.changeState) { 11448 this.node.removeAttribute("style"); //for sku 11449 if (value != this.state) { 11450 if (value) { 11451 BX.addClass(this.node, this.activeClass); 11452 } else { 11453 BX.removeClass(this.node, this.activeClass); 11454 } 11455 11456 let title = this.getStateTitle(value); 11457 this.node.setAttribute("title", title); 11458 11459 let button = this.node.querySelector(".info-buttons__item-text"); 11460 if (button) { 11461 button.setAttribute("title", title); 11462 } 11463 11464 if (BX.hasClass(this.node, "btn")) { 11465 const $likeText = this.node.querySelector(".like-text"); 11466 if ($likeText) { 11467 $likeText.textContent = title; 11468 } 11469 } 11470 } 11471 } 11472 }, 11473 11474 init: function () { 11475 if (!this.inited) { 11476 this.inited = true; 11477 11478 if (this.valid) { 11479 this.node.itemAction = this; 11480 this.parentNode = this.node.parentElement; 11481 11482 if (this.data.offers === "Y") { 11483 this.data = this.node.dataset; 11484 } 11485 11486 if (this.config.bindEvents) { 11487 this.unbindAllEvents(); 11488 this.bindEvents(); 11489 } 11490 } 11491 } 11492 }, 11493 11494 bindEvents: function () { 11495 if (this.valid) { 11496 if (typeof this.handlers.onClickNode === "function") { 11497 BX.bind(this.node, "click", BX.proxy(this.handlers.onClickNode, this)); 11498 } 11499 } 11500 }, 11501 11502 unbindEvents: function () { 11503 if (this.valid) { 11504 if (typeof this.handlers.onClickNode === "function") { 11505 BX.unbind(this.node, "click", BX.proxy(this.handlers.onClickNode, this)); 11506 } 11507 } 11508 }, 11509 11510 unbindAllEvents: function () { 11511 if (this.valid) { 11512 BX.unbindAll(this.node, "click"); 11513 } 11514 }, 11515 11516 fireEvent: function (event) { 11517 if (this.valid && !this.busy && typeof event === "object" && event) { 11518 let eventType = event.type; 11519 if (eventType) { 11520 if (eventType === "click") { 11521 BX.proxy(this.handlers.onClickNode, this)(event); 11522 } 11523 } 11524 } 11525 }, 11526 11527 isStateChanged: function () { 11528 return this.prevState !== null && this.prevState != this.state; 11529 }, 11530 11531 isItemChanged: function () { 11532 return this.node !== null && this.node.dataset["item"] != this.data.item; 11533 }, 11534 11535 getStateTitle: function (state) { 11536 if (this.valid) { 11537 if (state) { 11538 return this.node.getAttribute("data-title_added") || ""; 11539 } else { 11540 return this.node.getAttribute("data-title") || ""; 11541 } 11542 } 11543 11544 return ""; 11545 }, 11546 11547 getStateGoalCode: function (state) { 11548 return "goal_" + this.action + (state ? "_add" : "_remove"); 11549 }, 11550 11551 showStateNotice: function (state) { 11552 this.showNotice([this.node], state); 11553 }, 11554 showNotice: function (items, state = 1) { 11555 if (this.valid && typeof JNoticeSurface === "function") { 11556 let surface = JNoticeSurface.get(); 11557 let actionCapitalize = this.action.replace(/^\w/, (c) => c.toUpperCase()); 11558 let noticeFunc = "onAdd2" + actionCapitalize; 11559 11560 if (noticeFunc && typeof surface[noticeFunc] === "function") { 11561 surface[noticeFunc](items, state); 11562 } 11563 } 11564 }, 11565 11566 updateState: function () { 11567 if (this.valid && !this.busy) { 11568 this.busy = true; 11569 11570 this.node.blur(); 11571 11572 this.prevState = this.state; 11573 11574 this.sendRequest(); 11575 } 11576 }, 11577 11578 collectRequestData: async function () { 11579 const data = { fields: {} }; 11580
11581 data["fields"] = this.data; 11582 data["fields"]["state"] = Number(this.state); 11583 11584 return data; 11585 }, 11586 11587 sendRequest: function () { 11588 if (this.valid) { 11589 this.collectRequestData() 11590 .then((data) => { 11591 BX.ajax.runAction(this.requestUrl, { data }).then( 11592 (response) => { 11593 if (typeof this.onRequestSuccess === "function") { 11594 this.onRequestSuccess(response); 11595 } 11596 11597 if (typeof this.onRequestComplete === "function") { 11598 this.onRequestComplete(data); 11599 } 11600 }, 11601 (response) => { 11602 if (typeof this.onRequestFailure === "function") { 11603 this.onRequestFailure(response); 11604 } 11605 11606 if (typeof this.onRequestComplete === "function") { 11607 this.onRequestComplete(data); 11608 } 11609 } 11610 ); 11611 }) 11612 .catch(() => { 11613 setTimeout(() => { 11614 if (this.isStateChanged()) { 11615 // toggle state back 11616 this.state = this.prevState; 11617 this.prevState = null; 11618 } 11619 11620 if (this.parentNode) { 11621 BX.removeClass(this.parentNode, "loadings"); 11622 } 11623 11624 this.busy = false; 11625 }, 0); 11626 }); 11627 } 11628 }, 11629 11630 onRequestComplete: function (config) { 11631 setTimeout(() => { 11632 if (this.parentNode) { 11633 BX.removeClass(this.parentNode, "loadings"); 11634 } 11635 this.busy = false; 11636 }, 0); 11637 }, 11638 11639 onRequestSuccess: function (response) { 11640 if (response.status === "success") { 11641 if (this.action && response.data) { 11642 let actionUpper = this.action.toUpperCase(); 11643 11644 if (typeof arAsproCounters !== "object") { 11645 arAsproCounters = {}; 11646 } 11647 11648 if (typeof arAsproCounters[actionUpper] !== "object") { 11649 arAsproCounters[actionUpper] = {}; 11650 } 11651 11652 const data = response.data; 11653 if ("items" in data) { 11654 arAsproCounters[actionUpper].ITEMS = data.items; 11655 } 11656 11657 if ("count" in data) { 11658 arAsproCounters[actionUpper].COUNT = data.count; 11659 } 11660 11661 if ("title" in data) { 11662 arAsproCounters[actionUpper].TITLE = data.title; 11663 } 11664 11665 // update badges 11666 if ( 11667 this.class && 11668 typeof window[this.class] === "function" && 11669 typeof window[this.class].markBadges === "function" 11670 ) { 11671 window[this.class].markBadges(); 11672 } 11673 11674 let state = this.state; 11675 11676 // mark items 11677 if ( 11678 this.class && 11679 typeof window[this.class] === "function" && 11680 typeof window[this.class].markItems === "function" 11681 ) { 11682 window[this.class].markItems(); 11683 } 11684 11685 if (this.isStateChanged()) { 11686 // show notice 11687 this.showStateNotice(state); 11688 11689 if (this.config.fireGoals) { 11690 // fire goal 11691 BX.onCustomEvent("onCounterGoals", [ 11692 { 11693 goal: this.getStateGoalCode(state), 11694 params: { 11695 id: this.node.getAttribute("data-item"), 11696 }, 11697 }, 11698 ]); 11699 } 11700 } 11701 11702 this.onCompleteEvent(); 11703 } 11704 } else { 11705 console.error(response); 11706 11707 if (this.isStateChanged()) { 11708 // toggle state back 11709 this.state = this.prevState; 11710 } 11711 11712 // show error notice 11713 if (typeof JNoticeSurface === "function") { 11714 let surface = JNoticeSurface.get(); 11715 response.error = this.getMessageFromErrors(response.errors); 11716 11717 surface.onResultError && surface.onResultError(response); 11718 } 11719 } 11720 }, 11721 11722 onRequestFailure: function (xhr) { 11723 if (this.isStateChanged()) { 11724 // toggle state back 11725 this.state = this.prevState; 11726 } 11727 11728 // show error notice 11729 if (typeof JNoticeSurface === "function") { 11730 let surface = JNoticeSurface.get(); 11731 xhr.statusText = this.getMessageFromErrors(xhr.errors); 11732 11733 surface.onRequestError && surface.onRequestError(xhr); 11734 } 11735 }, 11736 11737 getMessageFromErrors: function (errors) { 11738 let messages = []; 11739 if (errors.length) {
11740 errors.forEach((error) => { 11741 messages.push(error.message); 11742 }); 11743 } 11744 return messages.join("<br>"); 11745 }, 11746 11747 onCompleteEvent: function () { 11748 this.finalAction(); 11749 }, 11750 11751 finalAction: function () { 11752 this.updateDropdownBlocks(this.action); 11753 }, 11754 11755 updateDropdownBlocks: function (action) { 11756 document.querySelectorAll(`.dropdown-${action}`).forEach((node) => { 11757 node.classList.remove("loaded"); 11758 }); 11759 }, 11760 11761 handlers: { 11762 onClickNode: function (event) { 11763 if (this.valid && !this.busy) { 11764 if (!event) { 11765 event = window.event; 11766 } 11767 11768 let target = event.target || event.srcElement; 11769 11770 if (typeof target !== "undefined" && target) { 11771 this.busy = true; 11772 11773 this.node.blur(); 11774 11775 this.prevState = this.state; 11776 this.state = !this.state; 11777 11778 this.sendRequest(); 11779 } 11780 } 11781 }, 11782 }, 11783 }; 11784 11785 JItemAction.checkItemAction = function (node) { 11786 return node.itemAction && node.itemAction instanceof JItemAction; 11787 }; 11788 11789 JItemAction.getItemAction = function (node) { 11790 return node.itemAction; 11791 }; 11792 11793 // factory: returns a concrete JItemAction instance 11794 JItemAction.factory = function (node, config) { 11795 if (typeof node === "object" && node && node instanceof Node) { 11796 if (JItemAction.checkItemAction(node)) { 11797 return JItemAction.getItemAction(node); 11798 } else { 11799 let action = (node.getAttribute("data-action") || "").trim(); 11800 if (action) { 11801 let actionCapitalize = action.replace(/^\w/, (c) => c.toUpperCase()); 11802 let className = "JItemAction" + actionCapitalize; 11803 if (typeof window[className] === "function") { 11804 return new window[className](node, config); 11805 } 11806 } 11807 } 11808 } 11809 11810 return new window.JItemAction(node, config); 11811 }; 11812 11813 // class JItemActionFavorite 11814 JItemActionFavorite = function (node, config) { 11815 JItemAction.apply(this, arguments); 11816 }; 11817 11818 JItemActionFavorite.prototype = Object.create(JItemAction.prototype); 11819 JItemActionFavorite.prototype.constructor = JItemActionFavorite; 11820 Object.defineProperties(JItemActionFavorite.prototype, { 11821 action: { 11822 get() { 11823 return "favorite"; 11824 }, 11825 }, 11826 }); 11827 11828 JItemActionFavorite.prototype.getStateGoalCode = function (state) { 11829 return "goal_wish" + (state ? "_add" : "_remove"); 11830 }; 11831 11832 // set current count into badges 11833 JItemActionFavorite.markBadges = function () { 11834 if ( 11835 typeof arAsproCounters === "object" && 11836 arAsproCounters && 11837 typeof arAsproCounters.FAVORITE === "object" && 11838 arAsproCounters.FAVORITE && 11839 typeof arAsproCounters.FAVORITE.COUNT !== "undefined" 11840 ) { 11841 let blocks = Array.prototype.slice.call(document.querySelectorAll(".basket-link.delay .js-count")); 11842 if (blocks.length) { 11843 for (let i in blocks) { 11844 blocks[i].textContent = arAsproCounters.FAVORITE.COUNT; 11845 if (arAsproCounters.FAVORITE.COUNT > 0) { 11846 BX.removeClass(blocks[i], "empted"); 11847 BX.addClass(blocks[i].closest(".basket-link.delay"), "basket-count"); 11848 BX.removeClass(blocks[i].closest(".basket-link.delay"), "counter-state--empty"); 11849 } else { 11850 BX.addClass(blocks[i], "empted"); 11851 BX.removeClass(blocks[i].closest(".basket-link.delay"), "basket-count"); 11852 BX.addClass(blocks[i].closest(".basket-link.delay"), "counter-state--empty"); 11853 } 11854 } 11855 11856 JItemAction.prototype.updateDropdownBlocks(JItemActionFavorite.prototype.action) 11857 } 11858 } 11859 }; 11860 11861 // setup active state for all current items 11862 JItemActionFavorite.markItems = function () { 11863 if ( 11864 typeof arAsproCounters === "object" && 11865 arAsproCounters && 11866 typeof arAsproCounters.FAVORITE === "object" && 11867 arAsproCounters.FAVORITE && 11868 typeof arAsproCounters.FAVORITE.ITEMS === "object" && 11869 arAsproCounters.FAVORITE.ITEMS 11870 ) { 11871 let blocks = Array.prototype.slice.call( 11872 document.querySelectorAll('.js-item-action.added.in[data-action="favorite"]') 11873 ); 11874 if (blocks.length) { 11875 for (let y in blocks) { 11876 let id = BX.data(blocks[y], "item"); 11877 if (id) { 11878 if (!arAsproCounters.FAVORITE.ITEMS[id] || BX.data(blocks[y], "offers") === "Y") { 11879 let itemAction = JItemAction.checkItemAction(blocks[y]) ? JItemAction.getItemAction(blocks[y]) : ""; 11880 11881 if (BX.data(blocks[y], "offers") === "Y") { 11882 if (itemAction && itemAction.isItemChanged()) { 11883 itemAction = new this(blocks[y]); 11884 } 11885 } 11886 11887 if (!itemAction) { 11888 itemAction = new this(blocks[y]); 11889 } 11890 11891 itemAction.state = false;
11892 } 11893 } 11894 } 11895 } 11896 11897 if (arAsproCounters.FAVORITE.ITEMS) { 11898 for (let i in arAsproCounters.FAVORITE.ITEMS) { 11899 let id = arAsproCounters.FAVORITE.ITEMS[i]; 11900 let blocks = Array.prototype.slice.call( 11901 document.querySelectorAll('.js-item-action[data-action="favorite"][data-item="' + id + '"]:not(.added.in)') 11902 ); 11903 11904 if (blocks.length) { 11905 for (let y in blocks) { 11906 let itemAction = JItemAction.checkItemAction(blocks[y]) 11907 ? JItemAction.getItemAction(blocks[y]) 11908 : new this(blocks[y]); 11909 itemAction.state = true; 11910 } 11911 } 11912 } 11913 } 11914 } 11915 }; 11916 11917 // class JItemActionCompare 11918 JItemActionCompare = function (node, config) { 11919 JItemAction.apply(this, arguments); 11920 }; 11921 11922 JItemActionCompare.prototype = Object.create(JItemAction.prototype); 11923 JItemActionCompare.prototype.constructor = JItemActionCompare; 11924 Object.defineProperties(JItemActionCompare.prototype, { 11925 action: { 11926 get() { 11927 return "compare"; 11928 }, 11929 }, 11930 }); 11931 11932 // setup active state for all current items 11933 JItemActionCompare.markItems = function () { 11934 if ( 11935 typeof arAsproCounters === "object" && 11936 arAsproCounters && 11937 typeof arAsproCounters.COMPARE === "object" && 11938 arAsproCounters.COMPARE && 11939 typeof arAsproCounters.COMPARE.ITEMS === "object" 11940 ) { 11941 let blocks = Array.prototype.slice.call( 11942 document.querySelectorAll('.js-item-action.added.in[data-action="compare"]') 11943 ); 11944 if (blocks.length) { 11945 for (let y in blocks) { 11946 let id = BX.data(blocks[y], "item"); 11947 if (id) { 11948 if (!arAsproCounters.COMPARE.ITEMS[id] || BX.data(blocks[y], "offers") === "Y") { 11949 let itemAction = JItemAction.checkItemAction(blocks[y]) ? JItemAction.getItemAction(blocks[y]) : ""; 11950 11951 if (BX.data(blocks[y], "offers") === "Y") { 11952 if (itemAction && itemAction.isItemChanged()) { 11953 itemAction = new this(blocks[y]); 11954 } 11955 } 11956 11957 if (!itemAction) { 11958 itemAction = new this(blocks[y]); 11959 } 11960 11961 itemAction.state = false; 11962 } 11963 } 11964 } 11965 } 11966 11967 if (arAsproCounters.COMPARE.ITEMS) { 11968 for (let i in arAsproCounters.COMPARE.ITEMS) { 11969 let id = arAsproCounters.COMPARE.ITEMS[i]; 11970 let blocks = Array.prototype.slice.call( 11971 document.querySelectorAll('.js-item-action[data-action="compare"][data-item="' + id + '"]:not(.added.in)') 11972 ); 11973 11974 if (blocks.length) { 11975 for (let y in blocks) { 11976 let itemAction = JItemAction.checkItemAction(blocks[y]) 11977 ? JItemAction.getItemAction(blocks[y]) 11978 : new this(blocks[y]); 11979 itemAction.state = true; 11980 } 11981 } 11982 } 11983 } 11984 } 11985 }; 11986 11987 // set current count into badges 11988 JItemActionCompare.markBadges = function () { 11989 if ( 11990 typeof arAsproCounters === "object" && 11991 arAsproCounters && 11992 typeof arAsproCounters.COMPARE === "object" && 11993 arAsproCounters.COMPARE && 11994 typeof arAsproCounters.COMPARE.COUNT !== "undefined" 11995 ) { 11996 let blocks = Array.prototype.slice.call(document.querySelectorAll(".compare .js-count")); 11997 if (blocks.length) { 11998 for (let i in blocks) { 11999 blocks[i].textContent = arAsproCounters.COMPARE.COUNT; 12000 if (arAsproCounters.COMPARE.COUNT > 0) { 12001 BX.removeClass(blocks[i], "empted"); 12002 BX.addClass(blocks[i].closest(".compare"), "basket-count"); 12003 BX.removeClass(blocks[i].closest(".compare"), "counter-state--empty"); 12004 } else { 12005 BX.addClass(blocks[i], "empted"); 12006 BX.removeClass(blocks[i].closest(".compare"), "basket-count"); 12007 BX.addClass(blocks[i].closest(".compare"), "counter-state--empty"); 12008 } 12009 } 12010 JItemAction.prototype.updateDropdownBlocks(JItemActionCompare.prototype.action) 12011 } 12012 } 12013 }; 12014 12015 JItemAction.actual = function () { 12016 if (typeof JItemActionFavorite === "function") { 12017 JItemActionFavorite.markItems(); 12018 JItemActionFavorite.markBadges(); 12019 } 12020 if (typeof JItemActionCompare === "function") { 12021 JItemActionCompare.markItems(); 12022 JItemActionCompare.markBadges(); 12023 } 12024 }; 12025 12026 // bind handler for click on .js-item-action 12027 BX.bindDelegate( 12028 document, 12029 "click", 12030 { 12031 class: "js-item-action", 12032 }, 12033 function (event) { 12034 if (!event) { 12035 event = window.event; 12036 } 12037 12038 BX.PreventDefault(event); 12039 12040 let target = event.target || event.srcElement; 12041 12042 if (typeof target !== "undefined" && target) { 12043 if (!target.closest(".opt_action")) { 12044 JItemAction.factory(this).fireEvent(event); 12045 } 12046 } 12047 } 12048 ); 12049 12050 // on complete loading content by ajax 12051 BX.addCustomEvent("onCompleteAction", function (eventdata) { 12052 try { 12053 if (eventdata.action === "ajaxContentLoaded") { 12054 JItemAction.actual(); 12055 } 12056 } catch (e) { 12057 console.error(e); 12058 } 12059 }); 12060 12061 BX.addCustomEvent("onSetBasketStatusBtn", function (eventdata) { 12062 JItemAction.actual(); 12063 }); 12064 12065 BX.addCustomEvent("onSetItemButtonStatus", function (eventdata) { 12066 JItemAction.actual(); 12067 }); 12068 12069 BX.addCustomEvent("onAjaxResponesTabs", function (eventdata) { 12070 JItemAction.actual(); 12071 setBasketStatusBtn(true); 12072 }); 12073 12074 BX.addCustomEvent("onFinalActionSKUInfo", function (eventdata) { 12075 JItemAction.actual(); 12076 }); 12077 12078 /* 12079 // set current items states 12080 readyDOM(function () { 12081 JItemAction.actual(); 12082 }); */ 12083} 12084 12085/* End */ 12086; 12087; /* Start:"a:4:{s:4:"full";s:75:"/bitrix/templates/aspro_max/js/autoload/select_offer_load.js?17507629761192";s:6:"source";
12087s:60:"/bitrix/templates/aspro_max/js/autoload/select_offer_load.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 12088// selectOffer js 12089function useOfferSelect() { 12090 BX.ready(() => { 12091 if (!("SelectOfferProp" in window)) { 12092 const $catalogItems = $(".load-offer-js"); 12093 if ($catalogItems.length) { 12094 $catalogItems.iAppear( 12095 function (e) { 12096 loadScripts( 12097 [ 12098 arAsproOptions.SITE_TEMPLATE_PATH + "/js/select_offer.min.js", 12099 arAsproOptions.SITE_TEMPLATE_PATH + "/js/select_offer_func.min.js", 12100 ] 12101 ); 12102 }, 12103 { accX: 0, accY: 100 } 12104 ); 12105 } 12106 } 12107 12108 if (!("appAspro" in window) || !window.appAspro.skuDetailJSLoad) { 12109 const $catalogDetail = $(".sku_in_detail"); 12110 if ($catalogDetail.length) { 12111 $catalogDetail.iAppear( 12112 function (e) { 12113 loadScripts(arAsproOptions.SITE_TEMPLATE_PATH + "/js/select_offer_detail.min.js"); 12114 }, 12115 { accX: 0, accY: 100 } 12116 ); 12117 } 12118 } 12119 12120 }); 12121} 12122/* End */ 12123; 12124; /* Start:"a:4:{s:4:"full";s:74:"/local/templates/.default/js/translate/jquery.cookie.min.js?17510098291300";s:6:"source";s:59:"/local/templates/.default/js/translate/jquery.cookie.min.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 12125/*! jquery.cookie v1.4.1 | MIT */ 12126!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?a(require("jquery")):a(jQuery)}(function(a){function b(a){return h.raw?a:encodeURIComponent(a)}function c(a){return h.raw?a:decodeURIComponent(a)}function d(a){return b(h.json?JSON.stringify(a):String(a))}function e(a){0===a.indexOf('"')&&(a=a.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return a=decodeURIComponent(a.replace(g," ")),h.json?JSON.parse(a):a}catch(b){}}function f(b,c){var d=h.raw?b:e(b);return a.isFunction(c)?c(d):d}var g=/\+/g,h=a.cookie=function(e,g,i){if(void 0!==g&&!a.isFunction(g)){if(i=a.extend({},h.defaults,i),"number"==typeof i.expires){var j=i.expires,k=i.expires=new Date;k.setTime(+k+864e5*j)}return document.cookie=[b(e),"=",d(g),i.expires?"; expires="+i.expires.toUTCString():"",i.path?"; path="+i.path:"",i.domain?"; domain="+i.domain:"",i.secure?"; secure":""].join("")}for(var l=e?void 0:{},m=document.cookie?document.cookie.split("; "):[],n=0,o=m.length;o>n;n++){var p=m[n].split("="),q=c(p.shift()),r=p.join("=");if(e&&e===q){l=f(r,g);break}e||void 0===(r=f(r))||(l[q]=r)}return l};h.defaults={},a.removeCookie=function(b,c){return void 0===a.cookie(b)?!1:(a.cookie(b,"",a.extend({},c,{expires:-1})),!a.cookie(b))}}); 12127/* End */ 12128; 12129; /* Start:"a:4:{s:4:"full";s:63:"/local/templates/.default/js/translate/script.js?17817046166363";s:6:"source";s:48:"/local/templates/.default/js/translate/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 12130$(function () { 12131 const googleTranslateConfig = { 12132 lang: "ru", 12133 }; 12134 12135 var Translate = { 12136 12137 12138 init: function () { 12139 Translate.load(); 12140 Translate.initEvents(); 12141 }, 12142 12143 load: function () { 12144 let type = 'pc'; 12145 12146 if ($(window).width() <= 1199) 12147 type = 'mob'; 12148 12149 12150 $.ajax({ 12151 url: '/include/top_page/lang.php', 12152 type: 'POST', 12153 data: {type: type}, 12154 success: function (html) { 12155 let transBlock = $(html); 12156 let target; 12157 12158 if ($(window).width() > 1199) { 12159 target = $('.header__top-item.fix-block'); 12160 12161 if ($('.float_wrapper.lang-block ')?.length === 0) 12162 target.before($(transBlock)); 12163 } else { 12164 target = $('#mobileheader .logo-block'); 12165 12166 if ($('.lang-block.m-lang')?.length === 0) 12167 target.after($(transBlock)); 12168 } 12169 12170 12171 Translate.TranslateInit(); 12172 } 12173 }); 12174 }, 12175 12176 initEvents: function () { 12177 $(document).on('click', '.lang-block .lng_btn', function () { 12178 let _this = $(this), 12179 block = _this.closest('.lang-block'), 12180 menu = block.find('.dropdown-menu'); 12181 12182 menu.toggleClass('show'); 12183 }); 12184 12185 $(window).resize(function () { 12186 Translate.load(); 12187 }); 12188 }, 12189 12190 TranslateInit: function () { 12191 let code = Translate.TranslateGetCode(); 12192 // ÐÐ°Ñ Ð¾Ð´Ð¸Ð¼ Ñлаг Ñ Ð²ÑбÑаннÑм ÑзÑком Ð´Ð»Ñ Ð¿ÐµÑевода и добавлÑем к Ð½ÐµÐ¼Ñ Ð°ÐºÑивнÑй клаÑÑ 12193 var activeElemLang = $(document).find('[data-google-lang="' + code + '"]'), 12194 activeLang = activeElemLang.addClass('language__img_active'), 12195 langBtn = $(".lng_btn img"); 12196 12197 if (code === googleTranslateConfig.lang) { 12198 // ÐÑли ÑзÑк по ÑмолÑаниÑ, ÑÐ¾Ð²Ð¿Ð°Ð´Ð°ÐµÑ Ñ ÑзÑком на коÑоÑÑй пеÑеводим 12199 // То оÑиÑаем кÑки 12200 Translate.TranslateClearCookie(); 12201 } 12202 12203 var link = activeLang.data().src; 12204 langBtn.attr("src", link); 12205 12206 // ÐниÑиализиÑÑем Ð²Ð¸Ð´Ð¶ÐµÑ Ñ ÑзÑком по ÑмолÑÐ°Ð½Ð¸Ñ 12207 new google.translate.TranslateElement({ 12208 pageLanguage: googleTranslateConfig.lang, 12209 }); 12210 12211 $(document).find('[data-google-lang]').click(function () { 12212 Translate.TranslateSetCookie($(this).attr("data-google-lang")) 12213 // ÐеÑезагÑÑжаем ÑÑÑаниÑÑ 12214 window.location.reload(); 12215 }); 12216 }, 12217 12218 TranslateGetCode: function () { 12219 // ÐÑли кÑки неÑ, Ñо пеÑедаем деÑолÑнÑй ÑзÑк 12220 let lang = (BX.getCookie('googtrans') !== undefined && BX.getCookie('googtrans') !== "null") ? BX.getCookie('googtrans') : googleTranslateConfig.lang; 12221 return lang.substr(-2); 12222 }, 12223 12224 TranslateClearCookie: function () { 12225 BX.setCookie('googtrans', null); 12226 BX.setCookie("googtrans", null, { 12227 domain: "." + document.domain, 12228 }); 12229 }, 12230 12231 TranslateSetCookie: function (code) { 12232 // ÐапиÑÑваем кÑки /ÑзÑк_коÑоÑÑй_пеÑеводим/ÑзÑк_на_коÑоÑÑй_пеÑеводим 12233 BX.setCookie('googtrans', "/auto/" + code); 12234 BX.setCookie("googtrans", "/auto/" + code, { 12235 domain: "." + document.domain, 12236 }); 12237 }, 12238 12239 12240 } 12241
12242 /* Translate.init(); */ 12243 12244 /* 12245 12246 const googleTranslateConfig = { 12247 lang: "ru", 12248 }; 12249 12250 var TranslateInit = window.TranslateInit = function () { 12251 let code = TranslateGetCode(); 12252 // ÐÐ°Ñ Ð¾Ð´Ð¸Ð¼ Ñлаг Ñ Ð²ÑбÑаннÑм ÑзÑком Ð´Ð»Ñ Ð¿ÐµÑевода и добавлÑем к Ð½ÐµÐ¼Ñ Ð°ÐºÑивнÑй клаÑÑ 12253 var activeElemLang = $(document).find('[data-google-lang="' + code + '"]'), 12254 activeLang = activeElemLang.addClass('language__img_active'), 12255 langBtn = $(".lng_btn img"); 12256 12257 if (code == googleTranslateConfig.lang) { 12258 // ÐÑли ÑзÑк по ÑмолÑаниÑ, ÑÐ¾Ð²Ð¿Ð°Ð´Ð°ÐµÑ Ñ ÑзÑком на коÑоÑÑй пеÑеводим 12259 // То оÑиÑаем кÑки 12260 TranslateClearCookie(); 12261 } 12262 12263 var link = activeLang.data().src; 12264 langBtn.attr("src", link); 12265 12266 // ÐниÑиализиÑÑем Ð²Ð¸Ð´Ð¶ÐµÑ Ñ ÑзÑком по ÑмолÑÐ°Ð½Ð¸Ñ 12267 new google.translate.TranslateElement({ 12268 pageLanguage: googleTranslateConfig.lang, 12269 }); 12270 12271 $(document).find('[data-google-lang]').click(function () { 12272 TranslateSetCookie($(this).attr("data-google-lang")) 12273 // ÐеÑезагÑÑжаем ÑÑÑаниÑÑ 12274 window.location.reload(); 12275 }); 12276 } 12277 12278 12279 function TranslateGetCode() { 12280 // ÐÑли кÑки неÑ, Ñо пеÑедаем деÑолÑнÑй ÑзÑк 12281 let lang = (BX.getCookie('googtrans') != undefined && BX.getCookie('googtrans') != "null") ? BX.getCookie('googtrans') : googleTranslateConfig.lang; 12282 return lang.substr(-2); 12283 } 12284 12285 function TranslateClearCookie() { 12286 BX.setCookie('googtrans', null); 12287 BX.setCookie("googtrans", null, { 12288 domain: "." + document.domain, 12289 }); 12290 } 12291 12292 function TranslateSetCookie(code) { 12293 // ÐапиÑÑваем кÑки /ÑзÑк_коÑоÑÑй_пеÑеводим/ÑзÑк_на_коÑоÑÑй_пеÑеводим 12294 BX.setCookie('googtrans', "/auto/" + code); 12295 BX.setCookie("googtrans", "/auto/" + code, { 12296 domain: "." + document.domain, 12297 }); 12298 } 12299 12300 $(document).on('click', '.slogan-inner .lng_btn', function () { 12301 let _this = $(this), 12302 block = _this.closest('.slogan-inner'), 12303 menu = block.find('.dropdown-menu'); 12304 12305 menu.toggleClass('show'); 12306 }); 12307 */ 12308}); 12309/* End */ 12310; 12311; /* Start:"a:4:{s:4:"full";s:89:"/local/templates/.default/components/scoder/modalcoupon/.default/script.js?17510344238191";s:6:"source";s:74:"/local/templates/.default/components/scoder/modalcoupon/.default/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 12312var scoder_modalcoupon; 12313var scoder_modalcoupon_answer; 12314 12315var sc_offsetLeft = 0; 12316var sc_offsetTop = 0; 12317var sc_offsetLeftAnswer = 0; 12318var sc_offsetTopAnswer = 0; 12319 12320function sc_get_cookie(name) { 12321 var matches = document.cookie.match(new RegExp( 12322 "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)" 12323 )); 12324 return matches ? decodeURIComponent(matches[1]) : undefined; 12325} 12326function sc_set_cookie(name, value, options) { 12327 options = options || {}; 12328 12329 var expires = options.expires; 12330 12331 if (typeof expires == "number" && expires) { 12332 var d = new Date(); 12333 d.setTime(d.getTime() + expires * 1000); 12334 expires = options.expires = d; 12335 } 12336 if (expires && expires.toUTCString) { 12337 options.expires = expires.toUTCString(); 12338 } 12339 12340 value = encodeURIComponent(value); 12341 12342 var updatedCookie = name + "=" + value; 12343 12344 for (var propName in options) { 12345 updatedCookie += "; " + propName; 12346 var propValue = options[propName]; 12347 if (propValue !== true) { 12348 updatedCookie += "=" + propValue; 12349 } 12350 } 12351 12352 document.cookie = updatedCookie; 12353} 12354function sc_delete_cookie(name) { 12355 sc_set_cookie(name, "", { 12356 expires: -1, 12357 path: '/' 12358 }) 12359} 12360function sc_gift_modal_show() 12361{ 12362 scoder_modalcoupon.show(); 12363} 12364function sc_gift_modal_close() 12365{ 12366 //запиÑаÑÑ Ð² кÑки, ÑÑо окно закÑÑÑо и не нÑжно обновлÑÑÑ 12367 BX.ajax({ 12368 url: '/bitrix/components/scoder/modalcoupon/ajax.api.php?'+BX.message('bitrix_sessid_get')+'&TIMECLOSE='+parseInt(BX.message('TIMECLOSE')), 12369 method: 'POST', 12370 data: {'action':"SC_CLOSE"}, 12371 onsuccess: function(data){ 12372 sc_set_cookie( 12373 'SC_CLOSE_COUPON', 12374 'Y', 12375 { 12376 expires: parseInt(BX.message('TIMECLOSE')), 12377 path: '/' 12378 } 12379 ); //пиÑем в кÑки 12380 }, 12381 onfailure: function(){ 12382 alert(BX.message('SCODER_ERROR')); 12383 } 12384 }); 12385} 12386BX.ready(function(){ 12387 if (BX.message('POSITION') == "bottom_left") 12388 { 12389 sc_offsetLeft = (-1)*($(window).width()-$("#sc-modalcoupon-form").width())/2; 12390 sc_offsetTop = ($(window).height()-$("#sc-modalcoupon-form").height())/2 - 80; 12391 12392 sc_offsetLeftAnswer = (-1)*($(window).width()-$("#sc-modal-answer").width())/2; 12393 sc_offsetTopAnswer = ($(window).height()-$("#sc-modal-answer").height())/2; 12394 } 12395 else if (BX.message('POSITION') == "bottom_right") 12396 { 12397 sc_offsetLeft = ($(window).width()-$("#sc-modalcoupon-form").width())/2-60; 12398 sc_offsetTop = ($(window).height()-$("#sc-modalcoupon-form").height())/2 - 80; 12399 12400 sc_offsetLeftAnswer = ($(window).width()-$("#sc-modal-answer").width())/2-60; 12401 sc_offsetTopAnswer = ($(window).height()-$("#sc-modal-answer").height())/2; 12402 } 12403 else if (BX.message('POSITION') == "top_left") 12404 { 12405 sc_offsetLeft = (-1)*($(window).width()-$("#sc-modalcoupon-form").width())/2; 12406 sc_offsetTop = (-1)*($(window).height()-$("#sc-modalcoupon-form").height())/2; 12407 12408 sc_offsetLeftAnswer = (-1)*($(window).width()-$("#sc-modal-answer").width())/2; 12409 sc_offsetTopAnswer = (-1)*($(window).height()-$("#sc-modal-answer").height())/2+80; 12410 } 12411 else if (BX.message('POSITION') == "top_right") 12412 { 12413 sc_offsetLeft = ($(window).width()-$("#sc-modalcoupon-form").width())/2-60; 12414 sc_offsetTop = (-1)*($(window).height()-$("#sc-modalcoupon-form").height())/2; 12415 12416 sc_offsetLeftAnswer = ($(window).width()-$("#sc-modal-answer").width())/2-60; 12417 sc_offsetTopAnswer = (-1)*($(window).height()-$("#sc-modal-answer").height())/2+60; 12418 } 12419 12420 scoder_modalcoupon = new BX.PopupWindow("scoder_modalcoupon_popup", null, { 12421 autoHide : (BX.message('AUTO_HIDE')=="Y"?true:false), 12422 content: BX('sc-modalcoupon-form'), 12423 zIndex: 0, 12424 offsetLeft: sc_offsetLeft, 12425 offsetTop: sc_offsetTop, 12426 closeByEsc : true, 12427 overlay: { 12428 backgroundColor: '#3a3f44', opacity: '0.7' 12429 }, 12430 draggable: {restrict: false}, 12431 events: { 12432 onAfterPopupShow: function () { 12433 $('.sc-toggle').hide(); 12434 12435 }, 12436 onPopupClose: function(){ //обÑабоÑÑик ÑобÑÑÐ¸Ñ Ð·Ð°ÐºÑÑÑÐ¸Ñ Ð¼Ð¾Ð´Ð°Ð»Ñного окна 12437 $('.sc-toggle').show(); 12438 sc_gift_modal_close(); 12439 } 12440 }, 12441 }); 12442 12443 if(sc_get_cookie('SC_NOT_SHOW_ICON_AFTER_CLOSE') !== "Y") { 12444 // console.log(sc_get_cookie('SC_NOT_SHOW_ICON_AFTER_CLOSE')); 12445 $('.sc-toggle').show(); 12446 } 12447 12448 12449 12450 scoder_modalcoupon_answer = new BX.PopupWindow("scoder_modalcoupon_answer_popup", null, { 12451 autoHide : (BX.message('AUTO_HIDE')=="Y"?true:false), 12452 content: BX('sc-modal-answer'), 12453 zIndex: 0, 12454 offsetLeft: sc_offsetLeftAnswer, 12455 offsetTop: sc_offsetTopAnswer, 12456 closeByEsc : true, 12457 overlay: { 12458 backgroundColor: '#3a3f44', opacity: '0.7' 12459 }, 12460 draggable: {restrict: false}, 12461 events: { 12462 onAfterPopupShow: function () { 12463 $('.sc-toggle').hide(); 12464 sc_set_cookie( 12465 'SC_YEAR_HIDE', 12466 'Y', 12467 { 12468 expires:62208000, 12469 path: '/' 12470 } 12471 ); 12472 }, 12473 }, 12474 }); 12475 12476 var is_userconsent = true; 12477 $(document).on('submit', '#sc-coupon-form', function(e) { 12478 var msg = $(this).serialize(); 12479 12480 $('.sc-errorMsg').html('').hide(); 12481 12482 if (BX.message('USER_CONSENT') == 'Y') 12483 { 12484 is_userconsent = false;
12485 var sc_control = BX.UserConsent.load(BX('sc-coupon-form')); //пÑовеÑка ÑоглаÑÐ¸Ñ 12486 if (!sc_control) 12487 { 12488 $('.sc-errorMsg').show().html(BX.message('SCODER_ERROR')); 12489 } 12490 //еÑли ÑоглаÑен 12491 if ($('input[name="sc_modalcoupon_userconsent_input"]').prop( "checked" )) 12492 is_userconsent = true; 12493 } 12494 12495 if (is_userconsent) 12496 { 12497 $('.sc-errorMsg').html('').hide(); 12498 BX.ajax({ 12499 url: '/bitrix/components/scoder/modalcoupon/ajax.api.php?USE_CAPTCHA='+BX.message('USE_CAPTCHA'), 12500 method: 'POST', 12501 data: msg, 12502 onsuccess: function(data){ 12503 12504 var obj = jQuery.parseJSON(data); 12505 if (obj.RESULT == 'FIND') 12506 { 12507 $('.sc-errorMsg').show().html(BX.message('SCODER_ERROR_EMAIL')); 12508 } 12509 else if (obj.RESULT == 'SUCCES') //еÑли Ñоздан ÑÑпеÑно 12510 { 12511 sc_gift_modal_close(); 12512 scoder_modalcoupon.close(); 12513 scoder_modalcoupon_answer.show(); //показаÑÑ Ð¾ÑÐ²ÐµÑ 12514 } 12515 else if (obj.RESULT == 'ERROR') 12516 { 12517 $('.sc-errorMsg').show().html(obj.TEXT); 12518 } 12519 12520 }, 12521 onfailure: function(){ 12522 $('.sc-errorMsg').show().html(BX.message('SCODER_ERROR')); 12523 } 12524 }); 12525 } 12526 else 12527 { 12528 $('.sc-errorMsg').show().html(BX.message('SCODER_ERROR_USERCONSENT')); 12529 12530 } 12531 12532 return false; 12533 }); 12534 12535 //закÑÑли Ð¸ÐºÐ¾Ð½ÐºÑ 12536 $(document).on('click', '#sc-icon-close', function(e) { 12537 $('.sc-toggle').hide(); 12538 //еÑли Ñказано "Ðе оÑобÑажаÑÑ Ð¸ÐºÐ¾Ð½ÐºÑ Ð¿Ð¾Ñле закÑÑÑиÑ" 12539 if (BX.message('NOT_SHOW_ICON_AFTER_CLOSE')=='Y') 12540 { 12541 sc_set_cookie( 12542 'SC_NOT_SHOW_ICON_AFTER_CLOSE', 12543 'Y', 12544 { 12545 expires:62208000, 12546 path: '/' 12547 } 12548 ); 12549 } 12550 12551 return false; 12552 }); 12553 //нажали на подаÑок 12554 $(document).on('click', '.sc-toggle', function(e) { 12555 sc_gift_modal_show(); 12556 }); 12557 //закÑÑÑÑ Ð¾ÐºÐ½Ð¾ оÑвеÑа 12558 $(document).on('click', '#sc-button-close', function(e) { 12559 scoder_modalcoupon_answer.close(); 12560 if (BX.message('IS_RELOAD_WINDOW')=='Y') 12561 { 12562 location.reload(); 12563 } 12564 12565 }); 12566 12567 //еÑли кÑпон не закÑÑÑ 12568 if (sc_get_cookie('SC_CLOSE_COUPON') != 'Y' 12569 && sc_get_cookie('SC_YEAR_HIDE') !='Y' 12570 && BX.message('IS_CLOSED')!="Y") 12571 { 12572 setTimeout(sc_gift_modal_show, parseInt(BX.message('TIMEOUT'))); 12573 12574 if (BX.message('IS_SHOW_ICON')!="Y") 12575 $('.sc-toggle').hide(); //ÑкÑÑваем Ð¸ÐºÐ¾Ð½ÐºÑ 12576 } 12577 12578 $('.sc-captcha-update').on('click', function(e) { 12579 $('#whiteBlock').show(); 12580 BX.ajax({ 12581 url: '/bitrix/components/scoder/modalcoupon/ajax.api.php?', 12582 method: 'POST', 12583 data: {'action':"SC_UPDATE_CAPTCHA", "sessid": $('#sessid').val()}, 12584 onsuccess: function(data){ 12585 $('#captchaImg').attr('src','/bitrix/tools/captcha.php?captcha_sid='+data); 12586 $('#captchaSid').val(data); 12587 $('#whiteBlock').hide(); 12588 }, 12589 onfailure: function(){ 12590 alert(BX.message('SCODER_ERROR')); 12591 } 12592 }); 12593 }); 12594 12595 moveModal(); 12596 $( window ).resize(function() { 12597 moveModal(); 12598 }); 12599 if (sc_get_cookie('SC_NOT_SHOW_ICON_AFTER_CLOSE') == 'Y') 12600 { 12601 $('.sc-toggle').hide(); 12602 } 12603}); 12604 12605function moveModal() { 12606 $('#scoder_modalcoupon_popup').css('margin-top', $('.bx-logo').outerHeight()-1+'px'); 12607 // $('#scoder_modalcoupon_popup').css('margin-top', $('.bx-logo').outerHeight()-1+'px'); 12608} 12609/* End */ 12610; 12611; /* Start:"a:4:{s:4:"full";s:64:"/bitrix/components/bitrix/search.title/script.js?178066595410573";s:6:"source";s:48:"/bitrix/components/bitrix/search.title/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 12612function JCTitleSearch(arParams) 12613{ 12614 var _this = this; 12615 12616 this.arParams = { 12617 'AJAX_PAGE': BX.util.htmlspecialcharsback(arParams.AJAX_PAGE), 12618 'CONTAINER_ID': arParams.CONTAINER_ID, 12619 'INPUT_ID': arParams.INPUT_ID, 12620 'MIN_QUERY_LEN': parseInt(arParams.MIN_QUERY_LEN, 10), 12621 }; 12622 12623 if (arParams.WAIT_IMAGE) 12624 { 12625 this.arParams.WAIT_IMAGE = arParams.WAIT_IMAGE; 12626 } 12627 12628 if (this.arParams.MIN_QUERY_LEN <= 0) 12629 { 12630 this.arParams.MIN_QUERY_LEN = 1; 12631 } 12632 12633 this.cache = []; 12634 this.cache_key = null; 12635 12636 this.startText = ''; 12637 this.running = false; 12638 this.runningCall = false; 12639 this.currentRow = -1; 12640 this.RESULT = null; 12641 this.CONTAINER = null; 12642 this.INPUT = null; 12643 this.WAIT = null; 12644 12645 this.ShowResult = function(result) 12646 { 12647 if (BX.type.isString(result)) 12648 { 12649 _this.RESULT.innerHTML = result; 12650 } 12651 12652 _this.RESULT.style.display = _this.RESULT.innerHTML === '' ? 'none' : 'block'; 12653 var pos = _this.adjustResultNode(); 12654 12655 // adjust left column to be an outline 12656 var resultPosition = null; 12657 var th = null; 12658 var tbl = BX.findChild(_this.RESULT, { 'tag': 'table', 'class': 'title-search-result' }, true); 12659 if (tbl) 12660 { 12661 th = BX.findChild(tbl, { 'tag': 'th' }, true); 12662 } 12663 12664 if (th) 12665 { 12666 var tablePosition = BX.pos(tbl); 12667 tablePosition.width = tablePosition.right - tablePosition.left; 12668 12669 var tableHeaderPosition = BX.pos(th); 12670 tableHeaderPosition.width = tableHeaderPosition.right - tableHeaderPosition.left; 12671 th.style.width = tableHeaderPosition.width + 'px'; 12672 12673 _this.RESULT.style.width = (pos.width + tableHeaderPosition.width) + 'px'; 12674 12675 // Move table to left by width of the first column 12676 _this.RESULT.style.left = (pos.left - tableHeaderPosition.width - 1) + 'px'; 12677 12678 // Shrink table when it's too wide 12679 if ((tablePosition.width - tableHeaderPosition.width) > pos.width) 12680 { 12681 _this.RESULT.style.width = (pos.width + tableHeaderPosition.width - 1) + 'px'; 12682 } 12683 12684 // Check if table is too wide and shrink result div to it's width 12685 tablePosition = BX.pos(tbl); 12686 resultPosition = BX.pos(_this.RESULT); 12687 if (resultPosition.right > tablePosition.right) 12688 { 12689 _this.RESULT.style.width = (tablePosition.right - tablePosition.left) + 'px'; 12690 } 12691 } 12692 12693 var fade = false;
12694 if (tbl) 12695 { 12696 fade = BX.findChild(_this.RESULT, { 'class': 'title-search-fader' }, true); 12697 } 12698 12699 if (fade && th) 12700 { 12701 resultPosition = BX.pos(_this.RESULT); 12702 fade.style.left = (resultPosition.right - resultPosition.left - 18) + 'px'; 12703 fade.style.width = 18 + 'px'; 12704 fade.style.top = 0 + 'px'; 12705 fade.style.height = (resultPosition.bottom - resultPosition.top) + 'px'; 12706 fade.style.display = 'block'; 12707 } 12708 }; 12709 12710 this.onKeyPress = function(keyCode) 12711 { 12712 var tbl = BX.findChild(_this.RESULT, { 'tag': 'table', 'class': 'title-search-result' }, true); 12713 if (!tbl) 12714 { 12715 return false; 12716 } 12717 12718 var i = 0; 12719 var cnt = tbl.rows.length; 12720 12721 switch (keyCode) 12722 { 12723 case 27: // escape key - close search div 12724 _this.RESULT.style.display = 'none'; 12725 _this.currentRow = -1; 12726 _this.UnSelectAll(); 12727 12728 return true; 12729 case 40: // down key - navigate down on search results 12730 if (_this.RESULT.style.display == 'none') 12731 { 12732 _this.RESULT.style.display = 'block'; 12733 } 12734 12735 var first = -1; 12736 for (i = 0; i < cnt; i++) 12737 { 12738 if (!BX.findChild(tbl.rows[i], { 'class': 'title-search-separator' }, true)) 12739 { 12740 if (first == -1) 12741 { 12742 first = i; 12743 } 12744 12745 if (_this.currentRow < i) 12746 { 12747 _this.currentRow = i; 12748 break; 12749 } 12750 else if (tbl.rows[i].className == 'title-search-selected') 12751 { 12752 tbl.rows[i].className = ''; 12753 } 12754 } 12755 } 12756 12757 if (i == cnt && _this.currentRow != i) 12758 { 12759 _this.currentRow = first; 12760 } 12761 12762 tbl.rows[_this.currentRow].className = 'title-search-selected'; 12763 12764 return true; 12765 case 38: // up key - navigate up on search results 12766 if (_this.RESULT.style.display == 'none') 12767 { 12768 _this.RESULT.style.display = 'block'; 12769 } 12770 12771 var last = -1; 12772 for (i = cnt - 1; i >= 0; i--) 12773 { 12774 if (!BX.findChild(tbl.rows[i], { 'class': 'title-search-separator' }, true)) 12775 { 12776 if (last == -1) 12777 { 12778 last = i; 12779 } 12780 12781 if (_this.currentRow > i) 12782 { 12783 _this.currentRow = i; 12784 break; 12785 } 12786 else if (tbl.rows[i].className == 'title-search-selected') 12787 { 12788 tbl.rows[i].className = ''; 12789 } 12790 } 12791 } 12792 12793 if (i < 0 && _this.currentRow != i) 12794 { 12795 _this.currentRow = last; 12796 } 12797 12798 tbl.rows[_this.currentRow].className = 'title-search-selected'; 12799 12800 return true; 12801 case 13: // enter key - choose current search result 12802 if (_this.RESULT.style.display == 'block') 12803 { 12804 for (i = 0; i < cnt; i++) 12805 { 12806 if ( 12807 _this.currentRow == i 12808 && !BX.findChild(tbl.rows[i], { 'class': 'title-search-separator' }, true) 12809 ) 12810 { 12811 var a = BX.findChild(tbl.rows[i], { 'tag': 'a' }, true); 12812 if (a) 12813 { 12814 window.location = a.href; 12815 12816 return true; 12817 } 12818 } 12819 } 12820 } 12821 12822 return false; 12823 default: 12824 break; 12825 } 12826 12827 return false; 12828 }; 12829 12830 this.onTimeout = function() 12831 { 12832 _this.onChange(function() { 12833 setTimeout(_this.onTimeout, 500); 12834 }); 12835 }; 12836 12837 this.onChange = function(callback) 12838 { 12839 if (_this.running) 12840 { 12841 _this.runningCall = true; 12842 12843 return; 12844 } 12845 _this.running = true; 12846 12847 if (_this.INPUT.value != _this.oldValue && _this.INPUT.value != _this.startText) 12848 { 12849 _this.oldValue = _this.INPUT.value; 12850 if (_this.INPUT.value.length >= _this.arParams.MIN_QUERY_LEN) 12851 { 12852 _this.cache_key = _this.arParams.INPUT_ID + '|' + _this.INPUT.value; 12853 if (_this.cache[_this.cache_key] == null) 12854 { 12855 if (_this.WAIT) 12856 { 12857 var pos = BX.pos(_this.INPUT); 12858 var height = (pos.bottom - pos.top) - 2; 12859 _this.WAIT.style.top = (pos.top + 1) + 'px'; 12860 _this.WAIT.style.height = height + 'px'; 12861 _this.WAIT.style.width = height + 'px'; 12862 _this.WAIT.style.left = (pos.right - height + 2) + 'px'; 12863 _this.WAIT.style.display = 'block'; 12864 } 12865 12866 BX.ajax.post( 12867 _this.arParams.AJAX_PAGE, 12868 { 12869 'ajax_call': 'y', 12870 'INPUT_ID': _this.arParams.INPUT_ID, 12871 'q': _this.INPUT.value, 12872 'l': _this.arParams.MIN_QUERY_LEN, 12873 }, 12874 function(result) 12875 { 12876 _this.cache[_this.cache_key] = result; 12877 _this.ShowResult(result); 12878 _this.currentRow = -1; 12879 _this.EnableMouseEvents(); 12880 if (_this.WAIT) 12881 { 12882 _this.WAIT.style.display = 'none'; 12883 } 12884 12885 if (!!callback) 12886 { 12887 callback(); 12888 } 12889 12890 _this.running = false;
12891 if (_this.runningCall) 12892 { 12893 _this.runningCall = false; 12894 _this.onChange(); 12895 } 12896 } 12897 ); 12898 12899 return; 12900 } 12901 12902 _this.ShowResult(_this.cache[_this.cache_key]); 12903 _this.currentRow = -1; 12904 _this.EnableMouseEvents(); 12905 } 12906 else 12907 { 12908 _this.RESULT.style.display = 'none'; 12909 _this.currentRow = -1; 12910 _this.UnSelectAll(); 12911 } 12912 } 12913 12914 if (!!callback) 12915 { 12916 callback(); 12917 } 12918 _this.running = false; 12919 }; 12920 12921 this.onScroll = function () 12922 { 12923 if (BX.type.isElementNode(_this.RESULT) 12924 && _this.RESULT.style.display !== 'none' 12925 && _this.RESULT.innerHTML !== '' 12926 ) 12927 { 12928 _this.adjustResultNode(); 12929 } 12930 }; 12931 12932 this.UnSelectAll = function() 12933 { 12934 var tbl = BX.findChild(_this.RESULT, { 'tag': 'table', 'class': 'title-search-result' }, true); 12935 if (tbl) 12936 { 12937 var cnt = tbl.rows.length; 12938 for (var i = 0; i < cnt; i++) 12939 { 12940 tbl.rows[i].className = ''; 12941 } 12942 } 12943 }; 12944 12945 this.EnableMouseEvents = function() 12946 { 12947 var tbl = BX.findChild(_this.RESULT, { 'tag': 'table', 'class': 'title-search-result' }, true); 12948 if (tbl) 12949 { 12950 var cnt = tbl.rows.length; 12951 for (var i = 0; i < cnt; i++) 12952 { 12953 if (!BX.findChild(tbl.rows[i], { 'class': 'title-search-separator' }, true)) 12954 { 12955 tbl.rows[i].id = 'row_' + i; 12956 tbl.rows[i].onmouseover = function (e) { 12957 if (_this.currentRow != this.id.substr(4)) 12958 { 12959 _this.UnSelectAll(); 12960 this.className = 'title-search-selected'; 12961 _this.currentRow = this.id.substr(4); 12962 } 12963 }; 12964 12965 tbl.rows[i].onmouseout = function (e) { 12966 this.className = ''; 12967 _this.currentRow = -1; 12968 }; 12969 } 12970 } 12971 } 12972 }; 12973 12974 this.onFocusLost = function(hide) 12975 { 12976 setTimeout(function() { _this.RESULT.style.display = 'none'; }, 250); 12977 }; 12978 12979 this.onFocusGain = function() 12980 { 12981 if (_this.RESULT.innerHTML.length > 0) 12982 { 12983 _this.ShowResult(); 12984 } 12985 }; 12986 12987 this.onKeyDown = function(e) 12988 { 12989 if (!e) 12990 { 12991 e = window.event; 12992 } 12993 12994 if (_this.RESULT.style.display == 'block' && _this.onKeyPress(e.keyCode)) 12995 { 12996 return BX.PreventDefault(e); 12997 } 12998 }; 12999 13000 this.adjustResultNode = function() 13001 { 13002 if (!(BX.type.isElementNode(_this.RESULT) 13003 && BX.type.isElementNode(_this.CONTAINER)) 13004 ) 13005 { 13006 return { top: 0, right: 0, bottom: 0, left: 0, width: 0, height: 0 }; 13007 } 13008 13009 var pos = BX.pos(_this.CONTAINER); 13010 13011 _this.RESULT.style.position = 'absolute'; 13012 _this.RESULT.style.top = (pos.bottom + 2) + 'px'; 13013 _this.RESULT.style.left = pos.left + 'px'; 13014 _this.RESULT.style.width = pos.width + 'px'; 13015 13016 return pos; 13017 }; 13018 13019 this.onContainerLayoutChange = function() 13020 { 13021 if (BX.type.isElementNode(_this.RESULT) 13022 && _this.RESULT.style.display !== 'none' 13023 && _this.RESULT.innerHTML !== '' 13024 ) 13025 { 13026 _this.adjustResultNode(); 13027 } 13028 }; 13029 13030 this.Init = function() 13031 { 13032 this.CONTAINER = document.getElementById(this.arParams.CONTAINER_ID); 13033 BX.addCustomEvent(this.CONTAINER, 'OnNodeLayoutChange', this.onContainerLayoutChange); 13034 13035 this.RESULT = document.body.appendChild(document.createElement("DIV")); 13036 this.RESULT.className = 'title-search-result'; 13037 this.INPUT = document.getElementById(this.arParams.INPUT_ID); 13038 this.startText = this.INPUT.value; 13039 this.oldValue = this.INPUT.value; 13040 BX.bind(this.INPUT, 'focus', function() { _this.onFocusGain(); }); 13041 BX.bind(this.INPUT, 'blur', function() { _this.onFocusLost(); }); 13042 this.INPUT.onkeydown = this.onKeyDown; 13043 13044 if (this.arParams.WAIT_IMAGE) 13045 { 13046 this.WAIT = document.body.appendChild(document.createElement('DIV')); 13047 this.WAIT.style.backgroundImage = "url('" + this.arParams.WAIT_IMAGE + "')"; 13048 if (!BX.browser.IsIE()) 13049 { 13050 this.WAIT.style.backgroundRepeat = 'none'; 13051 } 13052 this.WAIT.style.display = 'none'; 13053 this.WAIT.style.position = 'absolute'; 13054 this.WAIT.style.zIndex = '1100'; 13055 } 13056 13057 BX.bind(this.INPUT, 'bxchange', function() {_this.onChange()}); 13058 13059 var fixedParent = BX.findParent(this.CONTAINER, BX.is_fixed); 13060 if (BX.type.isElementNode(fixedParent)) 13061 { 13062 BX.bind(window, 'scroll', BX.throttle(this.onScroll, 100, this)); 13063 } 13064 }; 13065 13066 BX.ready(function() { _this.Init(arParams); }); 13067} 13068 13069/* End */ 13070; 13071; /* Start:"a:4:{s:4:"full";s:94:"/bitrix/templates/aspro_max/components/bitrix/search.title/mega_menu/script.js?175076298110679";s:6:"source";s:78:"/bitrix/templates/aspro_max/components/bitrix/search.title/mega_menu/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 13072function JCTitleSearch3(arParams) 13073{ 13074 var _this = this; 13075 13076 this.arParams = {
13077 'AJAX_PAGE': arParams.AJAX_PAGE, 13078 'CONTAINER_ID': arParams.CONTAINER_ID, 13079 'INPUT_ID': arParams.INPUT_ID, 13080 'MIN_QUERY_LEN': parseInt(arParams.MIN_QUERY_LEN) 13081 }; 13082 if(arParams.WAIT_IMAGE) 13083 this.arParams.WAIT_IMAGE = arParams.WAIT_IMAGE; 13084 if(arParams.MIN_QUERY_LEN <= 0) 13085 arParams.MIN_QUERY_LEN = 1; 13086 13087 this.cache = []; 13088 this.cache_key = null; 13089 13090 this.startText = ''; 13091 this.running = false; 13092 this.needRunAgain = false; 13093 this.currentRow = -1; 13094 this.RESULT = null; 13095 this.CONTAINER = null; 13096 this.INPUT = null; 13097 this.TYPE = null; 13098 this.WAIT = null; 13099 13100 this.ShowResult = function(result) 13101 { 13102 if(BX.type.isString(result)) 13103 { 13104 _this.RESULT.innerHTML = result; 13105 } 13106 13107 _this.RESULT.style.display = _this.RESULT.innerHTML !== '' ? 'block' : 'none'; 13108 var pos = _this.adjustResultNode(); 13109 13110 //adjust left column to be an outline 13111 var res_pos; 13112 var th; 13113 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13114 if(tbl) 13115 { 13116 th = BX.findChild(tbl, {'tag':'th'}, true); 13117 } 13118 if(th) 13119 { 13120 var tbl_pos = BX.pos(tbl); 13121 tbl_pos.width = tbl_pos.right - tbl_pos.left; 13122 13123 var th_pos = BX.pos(th); 13124 th_pos.width = th_pos.right - th_pos.left; 13125 th.style.width = th_pos.width + 'px'; 13126 13127 _this.RESULT.style.width = (pos.width + th_pos.width) + 'px'; 13128 13129 //Move table to left by width of the first column 13130 _this.RESULT.style.left = (pos.left - th_pos.width - 1)+ 'px'; 13131 13132 //Shrink table when it's too wide 13133 if((tbl_pos.width - th_pos.width) > pos.width) 13134 _this.RESULT.style.width = (pos.width + th_pos.width -1) + 'px'; 13135 13136 //Check if table is too wide and shrink result div to it's width 13137 tbl_pos = BX.pos(tbl); 13138 res_pos = BX.pos(_this.RESULT); 13139 if(res_pos.right > tbl_pos.right) 13140 { 13141 _this.RESULT.style.width = (tbl_pos.right - tbl_pos.left) + 'px'; 13142 } 13143 } 13144 13145 var fade; 13146 if(tbl) fade = BX.findChild(_this.RESULT, {'class':'title-search-fader'}, true); 13147 if(fade && th) 13148 { 13149 res_pos = BX.pos(_this.RESULT); 13150 fade.style.left = (res_pos.right - res_pos.left - 18) + 'px'; 13151 fade.style.width = 18 + 'px'; 13152 fade.style.top = 0 + 'px'; 13153 fade.style.height = (res_pos.bottom - res_pos.top) + 'px'; 13154 fade.style.display = 'block'; 13155 } 13156 13157 }; 13158 13159 this.onKeyPress = function(keyCode) 13160 { 13161 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13162 if(!tbl) 13163 return false; 13164 13165 var i; 13166 var cnt = tbl.rows.length; 13167 13168 switch (keyCode) 13169 { 13170 case 27: // escape key - close search div 13171 _this.RESULT.style.display = 'none'; 13172 _this.currentRow = -1; 13173 _this.UnSelectAll(); 13174 return true; 13175 13176 case 40: // down key - navigate down on search results 13177 if(_this.RESULT.style.display == 'none') 13178 _this.RESULT.style.display = 'block'; 13179 13180 var first = -1; 13181 for(i = 0; i < cnt; i++) 13182 { 13183 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13184 { 13185 if(first == -1) 13186 first = i; 13187 13188 if(_this.currentRow < i) 13189 { 13190 _this.currentRow = i; 13191 break; 13192 } 13193 else if(tbl.rows[i].className == 'title-search-selected') 13194 { 13195 tbl.rows[i].className = ''; 13196 } 13197 } 13198 } 13199 13200 if(i == cnt && _this.currentRow != i) 13201 _this.currentRow = first; 13202 13203 tbl.rows[_this.currentRow].className = 'title-search-selected'; 13204 return true; 13205 13206 case 38: // up key - navigate up on search results 13207 if(_this.RESULT.style.display == 'none') 13208 _this.RESULT.style.display = 'block'; 13209 13210 var last = -1; 13211 for(i = cnt-1; i >= 0; i--) 13212 { 13213 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13214 { 13215 if(last == -1) 13216 last = i; 13217 13218 if(_this.currentRow > i) 13219 { 13220 _this.currentRow = i; 13221 break; 13222 } 13223 else if(tbl.rows[i].className == 'title-search-selected') 13224 { 13225 tbl.rows[i].className = ''; 13226 } 13227 } 13228 } 13229 13230 if(i < 0 && _this.currentRow != i) 13231 _this.currentRow = last; 13232 13233 tbl.rows[_this.currentRow].className = 'title-search-selected'; 13234 return true; 13235 13236 case 13: // enter key - choose current search result 13237 if(_this.RESULT.style.display == 'block') 13238 { 13239 for(i = 0; i < cnt; i++) 13240 { 13241 if(_this.currentRow == i) 13242 { 13243 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13244 { 13245 var a = BX.findChild(tbl.rows[i], {'tag':'a'}, true); 13246 if(a) 13247 { 13248 window.location = a.href; 13249 return true; 13250 } 13251 } 13252 } 13253 } 13254 } 13255 return false;
13256 } 13257 13258 return false; 13259 }; 13260 13261 this.onTimeout = function() 13262 { 13263 _this.onChange(function(){ 13264 setTimeout(_this.onTimeout, 500); 13265 }); 13266 }; 13267 13268 this.onChange = function(callback) 13269 { 13270 if (_this.running) { 13271 _this.needRunAgain = true; 13272 return; 13273 } 13274 _this.running = true; 13275 13276 let type = 'catalog'; 13277 if (this.TYPE) { 13278 type = this.TYPE.value; 13279 } 13280 13281 if( 13282 ( 13283 _this.INPUT.value != _this.oldValue 13284 && _this.INPUT.value != _this.startText 13285 ) 13286 || type != _this.oldType 13287 ){ 13288 _this.oldValue = _this.INPUT.value; 13289 _this.oldType = type; 13290 13291 if(_this.INPUT.value.length >= _this.arParams.MIN_QUERY_LEN) 13292 { 13293 _this.cache_key = _this.arParams.INPUT_ID + '|' + _this.INPUT.value + '|' + type; 13294 if(_this.cache[_this.cache_key] == null) 13295 { 13296 if(_this.WAIT) 13297 { 13298 var pos = BX.pos(_this.INPUT); 13299 var height = (pos.bottom - pos.top)-2; 13300 _this.WAIT.style.top = (pos.top+1) + 'px'; 13301 _this.WAIT.style.height = height + 'px'; 13302 _this.WAIT.style.width = height + 'px'; 13303 _this.WAIT.style.left = (pos.right - height + 2) + 'px'; 13304 _this.WAIT.style.display = 'block'; 13305 } 13306 13307 BX.ajax.post( 13308 _this.arParams.AJAX_PAGE, 13309 { 13310 'ajax_call':'y', 13311 'INPUT_ID':_this.arParams.INPUT_ID, 13312 'q':_this.INPUT.value, 13313 'l':_this.arParams.MIN_QUERY_LEN, 13314 'type': type, 13315 }, 13316 function(result) 13317 { 13318 _this.cache[_this.cache_key] = result; 13319 _this.ShowResult(result); 13320 _this.currentRow = -1; 13321 _this.EnableMouseEvents(); 13322 if(_this.WAIT) 13323 _this.WAIT.style.display = 'none'; 13324 if (!!callback) 13325 callback(); 13326 _this.running = false; 13327 13328 if(_this.needRunAgain){ 13329 _this.needRunAgain = false; 13330 _this.onChange(callback); 13331 } 13332 } 13333 ); 13334 return; 13335 } 13336 else 13337 { 13338 _this.ShowResult(_this.cache[_this.cache_key]); 13339 _this.currentRow = -1; 13340 _this.EnableMouseEvents(); 13341 } 13342 } 13343 else 13344 { 13345 _this.RESULT.style.display = 'none'; 13346 _this.currentRow = -1; 13347 _this.UnSelectAll(); 13348 } 13349 } 13350 if (!!callback) 13351 callback(); 13352 _this.running = false; 13353 }; 13354 13355 this.UnSelectAll = function() 13356 { 13357 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13358 if(tbl) 13359 { 13360 var cnt = tbl.rows.length; 13361 for(var i = 0; i < cnt; i++) 13362 tbl.rows[i].className = ''; 13363 } 13364 }; 13365 13366 this.EnableMouseEvents = function() 13367 { 13368 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13369 if(tbl) 13370 { 13371 var cnt = tbl.rows.length; 13372 for(var i = 0; i < cnt; i++) 13373 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13374 { 13375 tbl.rows[i].id = 'row_' + i; 13376 tbl.rows[i].onmouseover = function (e) { 13377 if(_this.currentRow != this.id.substr(4)) 13378 { 13379 _this.UnSelectAll(); 13380 this.className = 'title-search-selected'; 13381 _this.currentRow = this.id.substr(4); 13382 } 13383 }; 13384 tbl.rows[i].onmouseout = function (e) { 13385 this.className = ''; 13386 _this.currentRow = -1; 13387 }; 13388 } 13389 } 13390 }; 13391 13392 this.onFocusLost = function(hide) 13393 { 13394 setTimeout(function(){_this.RESULT.style.display = 'none';}, 250); 13395 //_this.RESULT.style.display = 'none'; 13396 }; 13397 13398 this.onFocusGain = function() 13399 { 13400 if(_this.RESULT.innerHTML.length) 13401 _this.ShowResult(); 13402 }; 13403 13404 this.onKeyDown = function(e) 13405 { 13406 if(!e) 13407 e = window.event; 13408 13409 if (_this.RESULT.style.display == 'block') 13410 { 13411 if(_this.onKeyPress(e.keyCode)) 13412 return BX.PreventDefault(e); 13413 } 13414 13415 $('.title-search-result.'+_this.arParams.INPUT_ID).removeClass('closed'); 13416 }; 13417 13418 this.adjustResultNode = function() 13419 { 13420 var pos, pos_input; 13421 var fixedParent = BX.findParent(_this.CONTAINER, BX.is_fixed); 13422 /*if(!!fixedParent) 13423 { 13424 _this.RESULT.style.position = 'fixed'; 13425 _this.RESULT.style.zIndex = BX.style(fixedParent, 'z-index') + 2; 13426 pos = BX.pos(_this.CONTAINER, true); 13427 } 13428 else 13429 {*/ 13430 _this.RESULT.style.position = 'absolute'; 13431 pos = BX.pos(_this.CONTAINER, true); 13432 //} 13433 pos_input = BX.pos(_this.INPUT); 13434 13435 pos.width = pos.right - pos.left; 13436 _this.RESULT.style.top = (pos.bottom + 2) + 'px'; 13437 //_this.RESULT.style.left = pos_input.left + 'px'; 13438 _this.RESULT.style.left = 0 + 'px'; 13439 13440 if($(_this.INPUT).closest('.inline-search-block.with-close').length) 13441 _this.RESULT.style.width = pos_input.width + 'px'; 13442 else 13443 _this.RESULT.style.width = pos.width + 'px'; 13444 return pos; 13445 }; 13446 13447 this._onContainerLayoutChange = function() 13448 { 13449 if(_this.RESULT.style.display !== "none" && _this.RESULT.innerHTML !== '') 13450 { 13451 _this.adjustResultNode(); 13452 } 13453 }; 13454 this.Init = function() 13455 { 13456 this.CONTAINER = document.getElementById(this.arParams.CONTAINER_ID); 13457 BX.addCustomEvent(this.CONTAINER, "OnNodeLayoutChange", this._onContainerLayoutChange); 13458 13459 this.RESULT = this.CONTAINER.appendChild(document.createElement("DIV")); 13460 13461 this.RESULT.className = 'title-search-result '+this.arParams.INPUT_ID; 13462 this.INPUT = document.getElementById(this.arParams.INPUT_ID); 13463 this.startText = this.oldValue = this.INPUT.value; 13464 BX.bind(this.INPUT, 'focus', function() {_this.onFocusGain()}); 13465 BX.bind(this.INPUT, 'blur', function() { 13466 if (window.matchMedia("(min-width: 993px)").matches) { 13467 setTimeout(function(){ 13468 if(!$(_this.INPUT).closest('form').find('.dropdown-select.searchtype .dropdown-select__title.opened').length){ 13469 _this.onFocusLost(); 13470 } 13471 }, 100); 13472 } 13473 }); 13474 13475 this.TYPE = this.CONTAINER ? this.CONTAINER.querySelector('.dropdown-select.searchtype input[name="type"]') : null; 13476 13477 if(BX.browser.IsSafari() || BX.browser.IsIE()) 13478 this.INPUT.onkeydown = this.onKeyDown; 13479 else 13480 this.INPUT.onkeypress = this.onKeyDown; 13481 13482 if(this.arParams.WAIT_IMAGE) 13483 { 13484 this.WAIT = document.body.appendChild(document.createElement("DIV")); 13485 this.WAIT.style.backgroundImage = "url('" + this.arParams.WAIT_IMAGE + "')"; 13486 if(!BX.browser.IsIE()) 13487 this.WAIT.style.backgroundRepeat = 'none'; 13488 this.WAIT.style.display = 'none'; 13489 this.WAIT.style.position = 'absolute'; 13490 this.WAIT.style.zIndex = '1100'; 13491 } 13492 13493 BX.bind(this.INPUT, 'bxchange', function() {_this.onChange()}); 13494
13495 if (this.TYPE) { 13496 BX.bind(this.TYPE, 'change', function() {_this.onChange()}); 13497 } 13498 }; 13499 BX.ready(function (){_this.Init(arParams)}); 13500} 13501 13502/* End */ 13503; 13504; /* Start:"a:4:{s:4:"full";s:60:"/bitrix/templates/aspro_max/js/searchtitle.js?17507629701367";s:6:"source";s:45:"/bitrix/templates/aspro_max/js/searchtitle.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 13505$(document).on('click', '.dropdown-select.searchtype .dropdown-select__list-link:not(.dropdown-select__list-link--current)', function(){ 13506 let $this = $(this); 13507 let type = $this.data('type'); 13508 let name = type === 'all' ? BX.message('SEARCH_IN_SITE') : BX.message('SEARCH_IN_CATALOG'); 13509 13510 BX.onCustomEvent("onCloseDropDown"); 13511 13512 $.cookie('searchtitle_type', type); 13513 13514 $this.closest('.dropdown-select').find('input[name=type]').val(type); 13515 13516 // remove already visible results 13517 $('.title-search-result').hide().empty(); 13518 13519 // fire new search request 13520 BX.fireEvent($this.closest('.dropdown-select').find('input[name=type]')[0], 'change'); 13521 13522 $('.dropdown-select.searchtype').each(function(){ 13523 $(this).closest('form').attr('action', type === 'all' ? arAsproOptions.PAGES.SEARCH_PAGE_URL : arAsproOptions.PAGES.CATALOG_PAGE_URL); 13524 $(this).find('.dropdown-select__title>span').text(name); 13525 $(this).find('input[name=type]').val(type); 13526 13527 $(this).find('.dropdown-select__list-link').removeClass('dropdown-select__list-link--current').addClass('darken'); 13528 $(this).find('.dropdown-select__list-link[data-type=' + type + ']').addClass('dropdown-select__list-link--current').removeClass('darken'); 13529 }); 13530 13531 try { 13532 $this.closest('form').find('input[name=q]')[0].focus(); 13533 } 13534 catch (e) { 13535 } 13536}); 13537/* End */ 13538; 13539; /* Start:"a:4:{s:4:"full";s:89:"/bitrix/templates/aspro_max/components/bitrix/search.title/corp/script.
13539js?175076298110699";s:6:"source";s:73:"/bitrix/templates/aspro_max/components/bitrix/search.title/corp/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 13540function JCTitleSearch4(arParams) 13541{ 13542 var _this = this; 13543 13544 this.arParams = { 13545 'AJAX_PAGE': arParams.AJAX_PAGE, 13546 'CONTAINER_ID': arParams.CONTAINER_ID, 13547 'INPUT_ID': arParams.INPUT_ID, 13548 'INPUT_ID_TMP': arParams.INPUT_ID_TMP, 13549 'MIN_QUERY_LEN': parseInt(arParams.MIN_QUERY_LEN) 13550 }; 13551 13552 if(arParams.WAIT_IMAGE) 13553 this.arParams.WAIT_IMAGE = arParams.WAIT_IMAGE; 13554 if(arParams.MIN_QUERY_LEN <= 0) 13555 arParams.MIN_QUERY_LEN = 1; 13556 13557 this.cache = []; 13558 this.cache_key = null; 13559 13560 this.startText = ''; 13561 this.running = false; 13562 this.needRunAgain = false; 13563 this.currentRow = -1; 13564 this.RESULT = null; 13565 this.CONTAINER = null; 13566 this.INPUT = null; 13567 this.TYPE = null; 13568 this.WAIT = null; 13569 13570 this.ShowResult = function(result) 13571 { 13572 if(BX.type.isString(result)) 13573 { 13574 _this.RESULT.innerHTML = result; 13575 } 13576 13577 _this.RESULT.style.display = _this.RESULT.innerHTML !== '' ? 'block' : 'none'; 13578 var pos = _this.adjustResultNode(); 13579 13580 //adjust left column to be an outline 13581 var res_pos; 13582 var th; 13583 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13584 if(tbl) 13585 { 13586 th = BX.findChild(tbl, {'tag':'th'}, true); 13587 } 13588 13589 if(th) 13590 { 13591 var tbl_pos = BX.pos(tbl); 13592 tbl_pos.width = tbl_pos.right - tbl_pos.left; 13593 13594 var th_pos = BX.pos(th); 13595 th_pos.width = th_pos.right - th_pos.left; 13596 th.style.width = th_pos.width + 'px'; 13597 13598 _this.RESULT.style.width = (pos.width + th_pos.width) + 'px'; 13599 13600 //Move table to left by width of the first column 13601 _this.RESULT.style.left = '0px';//(pos.left - th_pos.width - 1)+ 'px'; 13602 13603 //Shrink table when it's too wide 13604 if((tbl_pos.width - th_pos.width) > pos.width) 13605 _this.RESULT.style.width = (pos.width + th_pos.width -1) + 'px'; 13606 13607 //Check if table is too wide and shrink result div to it's width 13608 tbl_pos = BX.pos(tbl); 13609 res_pos = BX.pos(_this.RESULT); 13610 if(res_pos.right > tbl_pos.right) 13611 { 13612 _this.RESULT.style.width = (tbl_pos.right - tbl_pos.left) + 'px'; 13613 } 13614 } 13615 13616 var fade; 13617 if(tbl) fade = BX.findChild(_this.RESULT, {'class':'title-search-fader'}, true); 13618 if(fade && th) 13619 { 13620 res_pos = BX.pos(_this.RESULT); 13621 fade.style.left = (res_pos.right - res_pos.left - 18) + 'px'; 13622 fade.style.width = 18 + 'px'; 13623 fade.style.top = 0 + 'px'; 13624 fade.style.height = (res_pos.bottom - res_pos.top) + 'px'; 13625 fade.style.display = 'block'; 13626 } 13627 13628 }; 13629 13630 this.onKeyPress = function(keyCode) 13631 { 13632 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13633 if(!tbl) 13634 return false; 13635 13636 var i; 13637 var cnt = tbl.rows.length; 13638 13639 switch (keyCode) 13640 { 13641 case 27: // escape key - close search div 13642 _this.RESULT.style.display = 'none'; 13643 _this.currentRow = -1; 13644 _this.UnSelectAll(); 13645 return true; 13646 13647 case 40: // down key - navigate down on search results 13648 if(_this.RESULT.style.display == 'none') 13649 _this.RESULT.style.display = 'block'; 13650 13651 var first = -1; 13652 for(i = 0; i < cnt; i++) 13653 { 13654 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13655 { 13656 if(first == -1) 13657 first = i; 13658 13659 if(_this.currentRow < i) 13660 { 13661 _this.currentRow = i; 13662 break; 13663 } 13664 else if(tbl.rows[i].className == 'title-search-selected') 13665 { 13666 tbl.rows[i].className = ''; 13667 } 13668 } 13669 } 13670 13671 if(i == cnt && _this.currentRow != i) 13672 _this.currentRow = first; 13673 13674 tbl.rows[_this.currentRow].className = 'title-search-selected'; 13675 return true; 13676 13677 case 38: // up key - navigate up on search results 13678 if(_this.RESULT.style.display == 'none') 13679 _this.RESULT.style.display = 'block'; 13680 13681 var last = -1; 13682 for(i = cnt-1; i >= 0; i--) 13683 { 13684 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13685 { 13686 if(last == -1) 13687 last = i; 13688 13689 if(_this.currentRow > i) 13690 { 13691 _this.currentRow = i; 13692 break; 13693 } 13694 else if(tbl.rows[i].className == 'title-search-selected') 13695 { 13696 tbl.rows[i].className = ''; 13697 } 13698 } 13699 } 13700 13701 if(i < 0 && _this.currentRow != i) 13702 _this.currentRow = last; 13703 13704 tbl.rows[_this.currentRow].className = 'title-search-selected'; 13705 return true; 13706 13707 case 13: // enter key - choose current search result 13708 if(_this.RESULT.style.display == 'block') 13709 { 13710 for(i = 0; i < cnt; i++) 13711 { 13712 if(_this.currentRow == i) 13713 { 13714 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13715 { 13716 var a = BX.findChild(tbl.rows[i], {'tag':'a'}, true); 13717 if(a) 13718 { 13719 window.location = a.href; 13720 return true; 13721 } 13722 } 13723 } 13724 } 13725 } 13726 return false;
13727 } 13728 13729 return false; 13730 }; 13731 13732 this.onTimeout = function() 13733 { 13734 _this.onChange(function(){ 13735 setTimeout(_this.onTimeout, 500); 13736 }); 13737 }; 13738 13739 this.onChange = function(callback) 13740 { 13741 if (_this.running){ 13742 _this.needRunAgain = true; 13743 return; 13744 } 13745 _this.running = true; 13746 13747 let type = 'catalog'; 13748 if (this.TYPE) { 13749 type = this.TYPE.value; 13750 } 13751 13752 if( 13753 ( 13754 _this.INPUT.value != _this.oldValue 13755 && _this.INPUT.value != _this.startText 13756 ) 13757 || type != _this.oldType 13758 ){ 13759 _this.oldValue = _this.INPUT.value; 13760 _this.oldType = type; 13761 13762 if(_this.INPUT.value.length >= _this.arParams.MIN_QUERY_LEN) 13763 { 13764 _this.cache_key = _this.arParams.INPUT_ID + '|' + _this.INPUT.value + '|' + type; 13765 if(_this.cache[_this.cache_key] == null) 13766 { 13767 if(_this.WAIT) 13768 { 13769 var pos = BX.pos(_this.INPUT); 13770 var height = (pos.bottom - pos.top)-2; 13771 _this.WAIT.style.top = (pos.top+1) + 'px'; 13772 _this.WAIT.style.height = height + 'px'; 13773 _this.WAIT.style.width = height + 'px'; 13774 _this.WAIT.style.left = (pos.right - height + 2) + 'px'; 13775 _this.WAIT.style.display = 'block'; 13776 } 13777 13778 BX.ajax.post( 13779 _this.arParams.AJAX_PAGE, 13780 { 13781 'ajax_call':'y', 13782 'INPUT_ID':_this.arParams.INPUT_ID_TMP, 13783 'q':_this.INPUT.value, 13784 'l':_this.arParams.MIN_QUERY_LEN, 13785 'type': type, 13786 }, 13787 function(result) 13788 { 13789 _this.cache[_this.cache_key] = result; 13790 _this.ShowResult(result); 13791 _this.currentRow = -1; 13792 _this.EnableMouseEvents(); 13793 if(_this.WAIT) 13794 _this.WAIT.style.display = 'none'; 13795 if (!!callback) 13796 callback(); 13797 _this.running = false; 13798 13799 if(_this.needRunAgain){ 13800 _this.needRunAgain = false; 13801 _this.onChange(callback); 13802 } 13803 } 13804 ); 13805 return; 13806 } 13807 else 13808 { 13809 _this.ShowResult(_this.cache[_this.cache_key]); 13810 _this.currentRow = -1; 13811 _this.EnableMouseEvents(); 13812 } 13813 } 13814 else 13815 { 13816 _this.RESULT.style.display = 'none'; 13817 _this.currentRow = -1; 13818 _this.UnSelectAll(); 13819 } 13820 } 13821 if (!!callback) 13822 callback(); 13823 _this.running = false; 13824 }; 13825 13826 this.UnSelectAll = function() 13827 { 13828 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13829 if(tbl) 13830 { 13831 var cnt = tbl.rows.length; 13832 for(var i = 0; i < cnt; i++) 13833 tbl.rows[i].className = ''; 13834 } 13835 }; 13836 13837 this.EnableMouseEvents = function() 13838 { 13839 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 13840 if(tbl) 13841 { 13842 var cnt = tbl.rows.length; 13843 for(var i = 0; i < cnt; i++) 13844 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 13845 { 13846 tbl.rows[i].id = 'row_' + i; 13847 tbl.rows[i].onmouseover = function (e) { 13848 if(_this.currentRow != this.id.substr(4)) 13849 { 13850 _this.UnSelectAll(); 13851 this.className = 'title-search-selected'; 13852 _this.currentRow = this.id.substr(4); 13853 } 13854 }; 13855 tbl.rows[i].onmouseout = function (e) { 13856 this.className = ''; 13857 _this.currentRow = -1; 13858 }; 13859 } 13860 } 13861 }; 13862 13863 this.onFocusLost = function(hide) 13864 { 13865 setTimeout(function(){_this.RESULT.style.display = 'none';}, 300); 13866 // _this.RESULT.style.display = 'none'; 13867 }; 13868 13869 this.onFocusGain = function() 13870 { 13871 if(_this.RESULT.innerHTML.length) 13872 _this.ShowResult(); 13873 }; 13874 13875 this.onKeyDown = function(e) 13876 { 13877 if(!e) 13878 e = window.event; 13879 if (_this.RESULT.style.display == 'block') 13880 { 13881 if(_this.onKeyPress(e.keyCode)) 13882 return BX.PreventDefault(e); 13883 } 13884 }; 13885 13886 this.adjustResultNode = function() 13887 { 13888 var pos, pos_input; 13889 var fixedParent = BX.findParent(_this.CONTAINER, BX.is_fixed); 13890 // if(!!fixedParent) 13891 // { 13892 // _this.RESULT.style.position = 'fixed'; 13893 // _this.RESULT.style.zIndex = BX.style(fixedParent, 'z-index') + 2; 13894 // pos = BX.pos(_this.CONTAINER, true); 13895 // } 13896 // else 13897 // { 13898 _this.RESULT.style.position = 'absolute'; 13899 pos = BX.pos(_this.CONTAINER); 13900 // } 13901 pos_input = BX.pos(_this.INPUT); 13902 13903 pos.width = pos.right - pos.left; 13904 _this.RESULT.style.top = '100%'; 13905 _this.RESULT.style.left = '0px';//pos_input.left + 'px'; 13906 13907 if($(_this.INPUT).closest('.inline-search-block.with-close').length) 13908 _this.RESULT.style.width = pos_input.width + 'px'; 13909 else 13910 _this.RESULT.style.width = pos.width + 'px'; 13911 return pos; 13912 }; 13913 13914 this._onContainerLayoutChange = function() 13915 { 13916 if(_this.RESULT.style.display !== "none" && _this.RESULT.innerHTML !== '') 13917 { 13918 _this.adjustResultNode(); 13919 } 13920 }; 13921 this.Init = function() 13922 { 13923 this.CONTAINER = document.getElementById(this.arParams.CONTAINER_ID); 13924 BX.addCustomEvent(this.CONTAINER, "OnNodeLayoutChange", this._onContainerLayoutChange); 13925 13926 this.RESULT = this.CONTAINER.appendChild(document.createElement("DIV")); 13927 13928 this.RESULT.className = 'title-search-result '+this.arParams.INPUT_ID; 13929 this.INPUT = document.getElementById(this.arParams.INPUT_ID); 13930 this.startText = this.oldValue = this.INPUT.value; 13931 BX.bind(this.INPUT, 'focus', function(e) { 13932 _this.onFocusGain() 13933 }); 13934 BX.bind(this.INPUT, 'blur', function(e) { 13935 if(!$(e.relatedTarget).hasClass('bx_item_block')){ 13936 if (window.matchMedia("(min-width: 993px)").matches) { 13937 setTimeout(function(){ 13938 if(!$(_this.INPUT).closest('form').find('.dropdown-select.searchtype .dropdown-select__title.opened').length){ 13939 _this.onFocusLost(); 13940 } 13941 }, 100); 13942 } 13943 } 13944 }); 13945 13946 this.TYPE = this.CONTAINER ? this.CONTAINER.querySelector('.dropdown-select.searchtype input[name="type"]') : null; 13947 13948 if(BX.browser.IsSafari() || BX.browser.IsIE()) 13949 this.INPUT.onkeydown = this.onKeyDown; 13950 else 13951 this.INPUT.onkeypress = this.onKeyDown; 13952 13953 if(this.arParams.WAIT_IMAGE) 13954 { 13955 this.WAIT = document.body.appendChild(document.createElement("DIV")); 13956 this.WAIT.style.backgroundImage = "url('" + this.arParams.WAIT_IMAGE + "')"; 13957 if(!BX.browser.IsIE()) 13958 this.WAIT.style.backgroundRepeat = 'none'; 13959 this.WAIT.style.display = 'none'; 13960 this.WAIT.style.position = 'absolute'; 13961 this.WAIT.style.zIndex = '1100'; 13962 } 13963 13964 BX.bind(this.INPUT, 'bxchange', function(e) {_this.onChange()}); 13965
13966 if (this.TYPE) { 13967 BX.bind(this.TYPE, 'change', function() {_this.onChange()}); 13968 } 13969 }; 13970 BX.ready(function (){_this.Init(arParams)}); 13971} 13972 13973/* End */ 13974; 13975; /* Start:"a:4:{s:4:"full";s:58:"/bitrix/templates/aspro_max/js/mega_menu.js?17507629991064";s:6:"source";s:43:"/bitrix/templates/aspro_max/js/mega_menu.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 13976window.addEventListener("DOMContentLoaded", function () { 13977 const $megaMenuWrapper = document.querySelectorAll(".menu-block, .menu-only"); 13978 13979 if ($megaMenuWrapper.length) { 13980 for (let i = 0; i < $megaMenuWrapper.length; i++) { 13981 $megaMenuWrapper[i].addEventListener( 13982 "mouseover", 13983 function () { 13984 // calculate menu items position 13985 $megaMenuWrapper[i].querySelector(".mega-menu").classList.add("visible"); 13986 CheckTopVisibleMenu(); 13987 InitMenuNavigationAim(); 13988 13989 // init banner 13990 const $bannerMenu = $megaMenuWrapper[i].querySelectorAll(".owl-carousel-hover"); 13991 if ($bannerMenu.length) { 13992 $bannerMenu.forEach(($el) => { 13993 $el.classList.remove("owl-carousel-hover"); 13994 $el.classList.add("swiper"); 13995 13996 setTimeout(function () { 13997 initSwiperSlider(); 13998 $el.classList.remove("loader_circle"); 13999 }, 1); 14000 }); 14001 } 14002 }, 14003 { 14004 once: true, 14005 } 14006 ); 14007 } 14008 } 14009}); 14010 14011/* End */ 14012; 14013; /* Start:"a:4:{s:4:"full";s:86:"/bitrix/templates/aspro_max/components/bitrix/news.list/banners/script.js?164759905586";s:6:"source";s:73:"/bitrix/templates/aspro_max/components/bitrix/news.list/banners/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 14014readyDOM(function () { 14015 checkLinkedBlocks(".linked-banners-list"); 14016}); 14017 14018 14019/* End */ 14020; 14021; /* Start:"a:4:{s:4:"full";s:81:"/bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.js?1669722329789";s:6:"source";s:67:"/bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 14022function setClassMobile() { 14023 if (arAsproOptions["THEME"] && arAsproOptions["THEME"]["COMPACT_FOOTER_MOBILE"] == "Y") { 14024 if (window.matchMedia("(max-width:767px)").matches) { 14025 $("footer").addClass("mobile"); 14026 $(".bottom-menu .items>.wrap_compact_mobile").addClass("accordion-body collapse"); 14027 $(".bottom-menu .items>.item.childs").attr("data-toggle", "collapse"); 14028 } else { 14029 $("footer").removeClass("mobile"); 14030 $(".bottom-menu .items>.wrap_compact_mobile").removeClass("accordion-body collapse"); 14031 $(".bottom-menu .items>.item.childs").removeAttr("data-toggle"); 14032 } 14033 } 14034} 14035readyDOM(function () { 14036 setClassMobile(); 14037}); 14038$(window).on('resize', function(){ 14039 setClassMobile(); 14040}); 14041/* End */ 14042; 14043; /* Start:"a:4:{s:4:"full";s:90:"/bitrix/templates/aspro_max/components/bitrix/search.title/fixed/script.js?175076297010790";s:6:"source";s:74:"/bitrix/templates/aspro_max/components/bitrix/search.title/fixed/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 14044function JCTitleSearch2(arParams) 14045{ 14046 var _this = this; 14047 14048 this.arParams = {
14049 'AJAX_PAGE': arParams.AJAX_PAGE, 14050 'CONTAINER_ID': arParams.CONTAINER_ID, 14051 'INPUT_ID': arParams.INPUT_ID, 14052 'INPUT_ID_TMP': arParams.INPUT_ID_TMP, 14053 'MIN_QUERY_LEN': parseInt(arParams.MIN_QUERY_LEN) 14054 }; 14055 if(arParams.WAIT_IMAGE) 14056 this.arParams.WAIT_IMAGE = arParams.WAIT_IMAGE; 14057 if(arParams.MIN_QUERY_LEN <= 0) 14058 arParams.MIN_QUERY_LEN = 1; 14059 14060 this.cache = []; 14061 this.cache_key = null; 14062 14063 this.startText = ''; 14064 this.running = false; 14065 this.needRunAgain = false; 14066 this.currentRow = -1; 14067 this.RESULT = null; 14068 this.CONTAINER = null; 14069 this.INPUT = null; 14070 this.TYPE = null; 14071 this.WAIT = null; 14072 14073 this.ShowResult = function(result) 14074 { 14075 if(BX.type.isString(result)) 14076 { 14077 _this.RESULT.innerHTML = result; 14078 } 14079 14080 _this.RESULT.style.display = _this.RESULT.innerHTML !== '' ? 'block' : 'none'; 14081 var pos = _this.adjustResultNode(); 14082 14083 //adjust left column to be an outline 14084 var res_pos; 14085 var th; 14086 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 14087 if(tbl) 14088 { 14089 th = BX.findChild(tbl, {'tag':'th'}, true); 14090 } 14091 if(th) 14092 { 14093 var tbl_pos = BX.pos(tbl); 14094 tbl_pos.width = tbl_pos.right - tbl_pos.left; 14095 14096 var th_pos = BX.pos(th); 14097 th_pos.width = th_pos.right - th_pos.left; 14098 th.style.width = th_pos.width + 'px'; 14099 14100 _this.RESULT.style.width = (pos.width + th_pos.width) + 'px'; 14101 14102 //Move table to left by width of the first column 14103 _this.RESULT.style.left = (pos.left - th_pos.width - 1)+ 'px'; 14104 14105 //Shrink table when it's too wide 14106 if((tbl_pos.width - th_pos.width) > pos.width) 14107 _this.RESULT.style.width = (pos.width + th_pos.width -1) + 'px'; 14108 14109 //Check if table is too wide and shrink result div to it's width 14110 tbl_pos = BX.pos(tbl); 14111 res_pos = BX.pos(_this.RESULT); 14112 if(res_pos.right > tbl_pos.right) 14113 { 14114 _this.RESULT.style.width = (tbl_pos.right - tbl_pos.left) + 'px'; 14115 } 14116 } 14117 14118 var fade; 14119 if(tbl) fade = BX.findChild(_this.RESULT, {'class':'title-search-fader'}, true); 14120 if(fade && th) 14121 { 14122 res_pos = BX.pos(_this.RESULT); 14123 fade.style.left = (res_pos.right - res_pos.left - 18) + 'px'; 14124 fade.style.width = 18 + 'px'; 14125 fade.style.top = 0 + 'px'; 14126 fade.style.height = (res_pos.bottom - res_pos.top) + 'px'; 14127 fade.style.display = 'block'; 14128 } 14129 }; 14130 14131 this.onKeyPress = function(keyCode) 14132 { 14133 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 14134 if(!tbl) 14135 return false; 14136 14137 var i; 14138 var cnt = tbl.rows.length; 14139 14140 switch (keyCode) 14141 { 14142 case 27: // escape key - close search div 14143 _this.RESULT.style.display = 'none'; 14144 _this.currentRow = -1; 14145 _this.UnSelectAll(); 14146 return true; 14147 14148 case 40: // down key - navigate down on search results 14149 if(_this.RESULT.style.display == 'none') 14150 _this.RESULT.style.display = 'block'; 14151 14152 var first = -1; 14153 for(i = 0; i < cnt; i++) 14154 { 14155 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 14156 { 14157 if(first == -1) 14158 first = i; 14159 14160 if(_this.currentRow < i) 14161 { 14162 _this.currentRow = i; 14163 break; 14164 } 14165 else if(tbl.rows[i].className == 'title-search-selected') 14166 { 14167 tbl.rows[i].className = ''; 14168 } 14169 } 14170 } 14171 14172 if(i == cnt && _this.currentRow != i) 14173 _this.currentRow = first; 14174 14175 tbl.rows[_this.currentRow].className = 'title-search-selected'; 14176 return true; 14177 14178 case 38: // up key - navigate up on search results 14179 if(_this.RESULT.style.display == 'none') 14180 _this.RESULT.style.display = 'block'; 14181 14182 var last = -1; 14183 for(i = cnt-1; i >= 0; i--) 14184 { 14185 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 14186 { 14187 if(last == -1) 14188 last = i; 14189 14190 if(_this.currentRow > i) 14191 { 14192 _this.currentRow = i; 14193 break; 14194 } 14195 else if(tbl.rows[i].className == 'title-search-selected') 14196 { 14197 tbl.rows[i].className = ''; 14198 } 14199 } 14200 } 14201 14202 if(i < 0 && _this.currentRow != i) 14203 _this.currentRow = last; 14204 14205 tbl.rows[_this.currentRow].className = 'title-search-selected'; 14206 return true; 14207 14208 case 13: // enter key - choose current search result 14209 if(_this.RESULT.style.display == 'block') 14210 { 14211 for(i = 0; i < cnt; i++) 14212 { 14213 if(_this.currentRow == i) 14214 { 14215 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 14216 { 14217 var a = BX.findChild(tbl.rows[i], {'tag':'a'}, true); 14218 if(a) 14219 { 14220 window.location = a.href; 14221 return true; 14222 } 14223 } 14224 } 14225 } 14226 } 14227 return false;
14228 } 14229 14230 return false; 14231 }; 14232 14233 this.onTimeout = function() 14234 { 14235 _this.onChange(function(){ 14236 setTimeout(_this.onTimeout, 500); 14237 }); 14238 }; 14239 14240 this.onChange = function(callback) 14241 { 14242 if (_this.running){ 14243 _this.needRunAgain = true; 14244 return; 14245 } 14246 _this.running = true; 14247 14248 let type = 'catalog'; 14249 if (this.TYPE) { 14250 type = this.TYPE.value; 14251 } 14252 14253 if( 14254 ( 14255 _this.INPUT.value != _this.oldValue 14256 && _this.INPUT.value != _this.startText 14257 ) 14258 || type != _this.oldType 14259 ){ 14260 _this.oldValue = _this.INPUT.value; 14261 _this.oldType = type; 14262 14263 if(_this.INPUT.value.length >= _this.arParams.MIN_QUERY_LEN) 14264 { 14265 _this.cache_key = _this.arParams.INPUT_ID + '|' + _this.INPUT.value + '|' + type; 14266 if(_this.cache[_this.cache_key] == null) 14267 { 14268 if(_this.WAIT) 14269 { 14270 var pos = BX.pos(_this.INPUT); 14271 var height = (pos.bottom - pos.top)-2; 14272 _this.WAIT.style.top = (pos.top+1) + 'px'; 14273 _this.WAIT.style.height = height + 'px'; 14274 _this.WAIT.style.width = height + 'px'; 14275 _this.WAIT.style.left = (pos.right - height + 2) + 'px'; 14276 _this.WAIT.style.display = 'block'; 14277 } 14278 14279 BX.ajax.post( 14280 _this.arParams.AJAX_PAGE, 14281 { 14282 'ajax_call':'y', 14283 'INPUT_ID':_this.arParams.INPUT_ID_TMP, 14284 'q':_this.INPUT.value, 14285 'l':_this.arParams.MIN_QUERY_LEN, 14286 'type': type, 14287 }, 14288 function(result) 14289 { 14290 _this.cache[_this.cache_key] = result; 14291 _this.ShowResult(result); 14292 _this.currentRow = -1; 14293 _this.EnableMouseEvents(); 14294 if(_this.WAIT) 14295 _this.WAIT.style.display = 'none'; 14296 if (!!callback) 14297 callback(); 14298 _this.running = false; 14299 14300 if(_this.needRunAgain){ 14301 _this.needRunAgain = false; 14302 _this.onChange(callback); 14303 } 14304 } 14305 ); 14306 return; 14307 } 14308 else 14309 { 14310 _this.ShowResult(_this.cache[_this.cache_key]); 14311 _this.currentRow = -1; 14312 _this.EnableMouseEvents(); 14313 } 14314 } 14315 else 14316 { 14317 _this.RESULT.style.display = 'none'; 14318 _this.currentRow = -1; 14319 _this.UnSelectAll(); 14320 } 14321 } 14322 if (!!callback) 14323 callback(); 14324 _this.running = false; 14325 }; 14326 14327 this.UnSelectAll = function() 14328 { 14329 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 14330 if(tbl) 14331 { 14332 var cnt = tbl.rows.length; 14333 for(var i = 0; i < cnt; i++) 14334 tbl.rows[i].className = ''; 14335 } 14336 }; 14337 14338 this.EnableMouseEvents = function() 14339 { 14340 var tbl = BX.findChild(_this.RESULT, {'tag':'table','class':'title-search-result'}, true); 14341 if(tbl) 14342 { 14343 var cnt = tbl.rows.length; 14344 for(var i = 0; i < cnt; i++) 14345 if(!BX.findChild(tbl.rows[i], {'class':'title-search-separator'}, true)) 14346 { 14347 tbl.rows[i].id = 'row_' + i; 14348 tbl.rows[i].onmouseover = function (e) { 14349 if(_this.currentRow != this.id.substr(4)) 14350 { 14351 _this.UnSelectAll(); 14352 this.className = 'title-search-selected'; 14353 _this.currentRow = this.id.substr(4); 14354 } 14355 }; 14356 tbl.rows[i].onmouseout = function (e) { 14357 this.className = ''; 14358 _this.currentRow = -1; 14359 }; 14360 } 14361 } 14362 }; 14363 14364 this.onFocusLost = function(hide) 14365 { 14366 setTimeout(function(){_this.RESULT.style.display = 'none';}, 300); 14367 // _this.RESULT.style.display = 'none'; 14368 }; 14369 14370 this.onFocusGain = function() 14371 { 14372 if(_this.RESULT.innerHTML.length) 14373 _this.ShowResult(); 14374 }; 14375 14376 this.onKeyDown = function(e) 14377 { 14378 if(!e) 14379 e = window.event; 14380 14381 if (_this.RESULT.style.display == 'block') 14382 { 14383 if(_this.onKeyPress(e.keyCode)) 14384 return BX.PreventDefault(e); 14385 } 14386 }; 14387 14388 this.adjustResultNode = function() 14389 { 14390 var pos, pos_input; 14391 var fixedParent = BX.findParent(_this.CONTAINER, BX.is_fixed); 14392 if(!!fixedParent) 14393 { 14394 _this.RESULT.style.position = 'fixed'; 14395 _this.RESULT.style.zIndex = BX.style(fixedParent, 'z-index') + 2; 14396 pos = BX.pos(_this.CONTAINER, true); 14397 } 14398 else 14399 { 14400 _this.RESULT.style.position = 'absolute'; 14401 pos = BX.pos(_this.CONTAINER); 14402 } 14403 //console.log(pos); 14404 //console.log(_this.CONTAINER); 14405 pos_input = BX.pos(_this.INPUT); 14406 14407 pos.width = pos.right - pos.left; 14408 _this.RESULT.style.top = (pos.bottom + 2) + 'px'; 14409 _this.RESULT.style.left = pos_input.left + 'px'; 14410 14411 if($(_this.INPUT).closest('.inline-search-block.with-close').length) 14412 _this.RESULT.style.width = pos_input.width + 'px'; 14413 else 14414 _this.RESULT.style.width = pos.width + 'px'; 14415 return pos; 14416 }; 14417 14418 this._onContainerLayoutChange = function() 14419 { 14420 if(_this.RESULT.style.display !== "none" && _this.RESULT.innerHTML !== '') 14421 { 14422 _this.adjustResultNode(); 14423 } 14424 }; 14425 this.Init = function() 14426 { 14427 this.CONTAINER = document.getElementById(this.arParams.CONTAINER_ID); 14428 BX.addCustomEvent(this.CONTAINER, "OnNodeLayoutChange", this._onContainerLayoutChange); 14429 14430 this.RESULT = document.body.appendChild(document.createElement("DIV")); 14431 14432 this.RESULT.className = 'title-search-result '+this.arParams.INPUT_ID; 14433 if(this.arParams.INPUT_ID != 'title-search-input_fixed') 14434 this.RESULT.className += ' '+arMaxOptions['THEME']['TYPE_SEARCH']+'_type'; 14435 14436 this.INPUT = document.getElementById(this.arParams.INPUT_ID); 14437 this.startText = this.oldValue = this.INPUT.value; 14438 14439 BX.bind(this.INPUT, 'focus', function() {_this.onFocusGain();}); 14440 BX.bind(this.INPUT, 'blur', function() { 14441 if (window.matchMedia("(min-width: 993px)").matches) { 14442 setTimeout(function(){ 14443 if(!$(_this.INPUT).closest('form').find('.dropdown-select.searchtype .dropdown-select__title.opened').length){ 14444 _this.onFocusLost(); 14445 } 14446 }, 100); 14447 } 14448 }); 14449 14450 this.TYPE = this.CONTAINER ? this.CONTAINER.querySelector('.dropdown-select.searchtype input[name="type"]') : null; 14451 14452 if(BX.browser.IsSafari() || BX.browser.IsIE()) 14453 this.INPUT.onkeydown = this.onKeyDown; 14454 else 14455 this.INPUT.onkeypress = this.onKeyDown; 14456 14457 if(this.arParams.WAIT_IMAGE) 14458 { 14459 this.WAIT = document.body.appendChild(document.createElement("DIV")); 14460 this.WAIT.style.backgroundImage = "url('" + this.arParams.WAIT_IMAGE + "')"; 14461 if(!BX.browser.IsIE()) 14462 this.WAIT.style.backgroundRepeat = 'none'; 14463 this.WAIT.style.display = 'none'; 14464 this.WAIT.style.position = 'absolute'; 14465 this.WAIT.style.zIndex = '1100'; 14466 } 14467 14468 BX.bind(this.INPUT, 'bxchange', function() {_this.onChange()}); 14469
14470 if (this.TYPE) { 14471 BX.bind(this.TYPE, 'change', function() {_this.onChange()}); 14472 } 14473 }; 14474 BX.ready(function (){_this.Init(arParams)}); 14475} 14476 14477/* End */ 14478; 14479; /* Start:"a:4:{s:4:"full";s:54:"/bitrix/templates/aspro_max/js/custom.js?1594113922100";s:6:"source";s:40:"/bitrix/templates/aspro_max/js/custom.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 14480/* 14481You can use this file with your scripts. 14482It will not be overwritten when you upgrade solution. 14483*/ 14484/* End */ 14485;; /* /bitrix/templates/aspro_max/js/lite.bootstrap.js?175076295819575*/ 14486; /* /bitrix/templates/aspro_max/js/jquery.actual.min.js?15941159261251*/ 14487; /* /bitrix/templates/aspro_max/vendor/js/ripple.js?15941159264702*/ 14488; /* /bitrix/templates/aspro_max/js/browser.js?15941159261032*/ 14489; /* /bitrix/templates/aspro_max/vendor/js/sticky-sidebar.js?160320671025989*/ 14490; /* /bitrix/templates/aspro_max/js/jquery.alphanumeric.js?15941159261972*/ 14491; /* /bitrix/templates/aspro_max/js/jquery.cookie.js?15941159263066*/ 14492; /* /bitrix/templates/aspro_max/js/mobile.js?175076299528083*/ 14493; /* /bitrix/templates/aspro_max/js/main.js?1750763006301154*/ 14494; /* /bitrix/templates/aspro_max/js/blocks/blocks.js?17507629956818*/ 14495; /* /bitrix/templates/aspro_max/js/logo.min.js?17507629773490*/ 14496; /* /bitrix/templates/aspro_max/js/autoload/dropdown-product.js?17507630011625*/ 14497; /* /bitrix/templates/aspro_max/js/autoload/item-action.js?175076300120332*/ 14498; /* /bitrix/templates/aspro_max/js/autoload/select_offer_load.js?17507629761192*/ 14499; /* /local/templates/.default/js/translate/jquery.cookie.min.js?17510098291300*/ 14500; /* /local/templates/.default/js/translate/script.js?17817046166363*/ 14501; /* /local/templates/.default/components/scoder/modalcoupon/.default/script.js?17510344238191*/ 14502; /* /bitrix/components/bitrix/search.title/script.js?178066595410573*/ 14503; /* /bitrix/templates/aspro_max/components/bitrix/search.title/mega_menu/script.js?175076298110679*/ 14504; /* /bitrix/templates/aspro_max/js/searchtitle.js?17507629701367*/ 14505; /* /bitrix/templates/aspro_max/components/bitrix/search.title/corp/script.
14505js?175076298110699*/ 14506; /* /bitrix/templates/aspro_max/js/mega_menu.js?17507629991064*/ 14507; /* /bitrix/templates/aspro_max/components/bitrix/news.list/banners/script.js?164759905586*/ 14508; /* /bitrix/templates/aspro_max/components/bitrix/menu/bottom/script.js?1669722329789*/ 14509; /* /bitrix/templates/aspro_max/components/bitrix/search.title/fixed/script.js?175076297010790*/ 14510; /* /bitrix/templates/aspro_max/js/custom.js?1594113922100*/
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.