1BX.ready(function(){ 2 window.tabsInitOnReady = function() { 3 loadScrollTabs('.tab_slider_wrapp .tabs_wrapper', () => { 4 $('.tab_slider_wrapp .tabs_wrapper').scrollTab({ 5 tabs_wrapper: '.tabs.ajax', 6 arrows_css: { 7 'top': '-1px', 8 }, 9 width_grow: 3, 10 onResize: function(options) { 11 var top_wrapper = options.scrollTab.closest('.top_block'); 12 if(top_wrapper.length) { 13 var tabs_wrapper = top_wrapper.find('.right_block_wrapper .tabs_wrapper'); 14 15 if(window.matchMedia('(max-width: 767px)').matches){ 16 tabs_wrapper.css({ 17 'width': '100%', 18 'max-width': '', 19 }); 20 return true; 21 } 22 23 var title = top_wrapper.find('h3'); 24 var right_link = top_wrapper.find('.right_block_wrapper > a'); 25 var all_width = top_wrapper[0].getBoundingClientRect().width; 26 27 if(title.length) { 28 all_width -= title.outerWidth(true); 29 } 30 31 if(right_link.length) { 32 all_width -= right_link.outerWidth(true); 33 } 34 35 all_width -= Number.parseInt(tabs_wrapper.css('margin-right')); 36 37 tabs_wrapper.css({ 38 'max-width': all_width, 39 'width': '', 40 }); 41 } 42 options.width = all_width; 43 } 44 }); 45 }) 46 } 47 48}); 49 50if (!window.JCCatalogSectionOnlyElement) 51{ 52 53 window.JCCatalogSectionOnlyElement = function (arParams) 54 { 55 if (typeof arParams === 'object') 56 { 57 this.params = arParams; 58 59 this.obProduct = null; 60 this.set_quantity = 1; 61 62 this.currentPriceMode = ''; 63 this.currentPrices = []; 64 this.currentPriceSelected = 0; 65 this.currentQuantityRanges = []; 66 this.currentQuantityRangeSelected = 0; 67 68 if (this.params.MESS) 69 { 70 this.mess = this.params.MESS; 71 } 72 73 this.init(); 74 } 75 } 76 window.JCCatalogSectionOnlyElement.prototype = { 77 init: function() 78 { 79 var i = 0, 80 j = 0, 81 treeItems = null; 82 83 this.obProduct = BX(this.params.ID); 84 85 if(!!this.obProduct) 86 { 87 $(this.obProduct).find('.counter_wrapp .counter_block input').data('product', 'ob'+this.obProduct.id+'el'); 88 this.currentPriceMode = this.params.ITEM_PRICE_MODE; 89 this.currentPrices = this.params.ITEM_PRICES; 90 this.currentQuantityRanges = this.params.ITEM_QUANTITY_RANGES; 91 } 92 93 }, 94 95 setPriceAction: function() 96 { 97 this.set_quantity = this.params.MIN_QUANTITY_BUY; 98 if($(this.obProduct).find('input[name=quantity]').length) 99 this.set_quantity = $(this.obProduct).find('input[name=quantity]').val(); 100 101 this.checkPriceRange(this.set_quantity); 102 103 $(this.obProduct).find('.not_matrix').hide(); 104 $(this.obProduct).find('.with_matrix .price_value_block').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_PRICE)); 105 106 if($(this.obProduct).find('.with_matrix .discount')) 107 { 108 $(this.obProduct).find('.with_matrix .discount').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].BASE_PRICE, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_BASE_PRICE)); 109 } 110 111 if(this.params.SHOW_DISCOUNT_PERCENT_NUMBER == 'Y') 112 { 113 if(this.currentPrices[this.currentPriceSelected].PERCENT > 0 && this.currentPrices[this.currentPriceSelected].PERCENT < 100) 114 { 115 if(!$(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 116 $('<div class="value"></div>').insertBefore($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .text')); 117 118 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').html('-<span>'+this.currentPrices[this.currentPriceSelected].PERCENT+'</span>%'); 119 } 120 else 121 { 122 if($(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').length) 123 $(this.obProduct).find('.with_matrix .sale_block .sale_wrapper .value').remove(); 124 } 125 } 126 $(this.obProduct).find('.with_matrix .sale_block .text .values_wrapper').html(getCurrentPrice(this.currentPrices[this.currentPriceSelected].DISCOUNT, this.currentPrices[this.currentPriceSelected].CURRENCY, this.currentPrices[this.currentPriceSelected].PRINT_DISCOUNT)); 127 128 if('NOT_SHOW' in this.params && this.params.NOT_SHOW != 'Y') 129 $(this.obProduct).find('.with_matrix').show(); 130 131 if(arMaxOptions['THEME']['SHOW_TOTAL_SUMM'] == 'Y') 132 { 133 if(typeof this.currentPrices[this.currentPriceSelected] !== 'undefined') 134 setPriceItem($(this.obProduct), this.set_quantity, this.currentPrices[this.currentPriceSelected].PRICE); 135 } 136 }, 137 138 checkPriceRange: function(quantity) 139 { 140 if (typeof quantity === 'undefined'|| this.currentPriceMode != 'Q') 141 return; 142 143 var range, found = false;
144 145 for (var i in this.currentQuantityRanges) 146 { 147 if (this.currentQuantityRanges.hasOwnProperty(i)) 148 { 149 range = this.currentQuantityRanges[i]; 150 151 if ( 152 parseInt(quantity) >= parseInt(range.SORT_FROM) 153 && ( 154 range.SORT_TO == 'INF' 155 || parseInt(quantity) <= parseInt(range.SORT_TO) 156 ) 157 ) 158 { 159 found = true; 160 this.currentQuantityRangeSelected = range.HASH; 161 break; 162 } 163 } 164 } 165 166 if (!found && (range = this.getMinPriceRange())) 167 { 168 this.currentQuantityRangeSelected = range.HASH; 169 } 170 171 for (var k in this.currentPrices) 172 { 173 if (this.currentPrices.hasOwnProperty(k)) 174 { 175 if (this.currentPrices[k].QUANTITY_HASH == this.currentQuantityRangeSelected) 176 { 177 this.currentPriceSelected = k; 178 break; 179 } 180 } 181 } 182 }, 183 184 getMinPriceRange: function() 185 { 186 var range; 187 188 for (var i in this.currentQuantityRanges) 189 { 190 if (this.currentQuantityRanges.hasOwnProperty(i)) 191 { 192 if ( 193 !range 194 || parseInt(this.currentQuantityRanges[i].SORT_FROM) < parseInt(range.SORT_FROM) 195 ) 196 { 197 range = this.currentQuantityRanges[i]; 198 } 199 } 200 } 201 202 return range; 203 } 204 } 205}
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.