1/*hover top products*/ 2$(document).on("mouseenter", ".header-favorite, .header-compare", function () { 3 if (window.matchMedia("(min-width: 992px)").matches) { 4 let _this = $(this); 5 let hover_block = _this.find(".product-dropdown-hover-block"); 6 let type = _this.hasClass('header-compare') ? 'compare' : 'favorite'; 7 let obParams = { 8 'type': type 9 } 10 if (!hover_block.hasClass("loaded")) { 11 BX.ajax.runAction('aspro:lite.DropdownProducts.show', { 12 data: { 13 params: obParams 14 }, 15 }).then( 16 response => { 17 let dropdown = $(`.${type}-dropdown`); 18 dropdown.addClass('loaded'); 19 dropdown.html(response.data.html); 20 }, 21 response => { 22 console.log('error'); 23 } 24 ); 25 } 26 } 27}); 28 29$(document).on("click", ".product-dropdown-hover-block .dropdown-product-action.remove", function () { 30 let _this = $(this); 31 let itemAction = JItemAction.factory(this); 32 itemAction.state = false; 33 34 _this.closest(".dropdown-product__item").fadeOut(400, () => { 35 let parentWrap = _this.closest(".product-dropdown-hover-block"); 36 let visibleItems = parentWrap.find(".dropdown-product__item:visible"); 37 if (!visibleItems.length) { 38 parentWrap.html(''); 39 } 40 }); 41 42 itemAction.updateState(); 43}); 44/**/
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.