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.Aspro.Utils.readyDOM(() => { 12 BX.Aspro.Loader.add({ 13 ext: 'dropdown-products', 14 }) 15 }); 16 BX.ajax.runAction('aspro:premier.DropdownProducts.show', { 17 data: { 18 params: obParams 19 }, 20 }).then( 21 response => { 22 let dropdown = $(`.${type}-dropdown`); 23 dropdown.addClass('loaded'); 24 dropdown.html(response.data.html); 25 }, 26 response => { 27 console.log('error'); 28 } 29 ); 30 } 31 } 32}); 33 34$(document).on("click", ".product-dropdown-hover-block .dropdown-product-action.remove", function () { 35 let _this = $(this); 36 let itemAction = JItemAction.factory(this); 37 itemAction.state = false; 38 39 _this.closest(".dropdown-product__item").fadeOut(400, () => { 40 let parentWrap = _this.closest(".product-dropdown-hover-block"); 41 let visibleItems = parentWrap.find(".dropdown-product__item:visible"); 42 if (!visibleItems.length) { 43 parentWrap.html(''); 44 } 45 }); 46 47 itemAction.updateState(); 48}); 49/**/
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.