1Flatsome.behavior('wishlist', { 2 attach: function (context) { 3 jQuery('.wishlist-button', context).each(function (index, element) { 4 'use strict' 5 6 jQuery(element).on('click', function (e) { 7 // Browse wishlist 8 if (jQuery(this).parent().find('.yith-wcwl-wishlistexistsbrowse, .yith-wcwl-wishlistaddedbrowse').length) { 9 var link = jQuery(this).parent().find('.yith-wcwl-wishlistexistsbrowse a, .yith-wcwl-wishlistaddedbrowse a').attr('href') 10 window.location.href = link 11 return 12 } 13 jQuery(this).addClass('loading') 14 // Delete or add item (only one of both is present). 15 jQuery(this).parent().find('.delete_item').click() 16 jQuery(this).parent().find('.add_to_wishlist').click() 17 18 e.preventDefault() 19 }) 20 }) 21 } 22}) 23 24jQuery(document).ready(function () { 25 var flatsomeAddToWishlist = function () { 26 jQuery('.wishlist-button').removeClass('loading') 27 jQuery('.wishlist-button').addClass('wishlist-added') 28 29 jQuery.ajax({ 30 beforeSend: function () { 31 32 }, 33 complete: function () { 34 35 }, 36 data: { 37 action: 'flatsome_update_wishlist_count', 38 }, 39 success: function (data) { 40 jQuery('i.wishlist-icon').addClass('added') 41 if (data == 0) { 42 jQuery('i.wishlist-icon').removeAttr('data-icon-label') 43 } 44 else if (data == 1) { 45 jQuery('i.wishlist-icon').attr('data-icon-label', '1') 46 } 47 else { 48 jQuery('i.wishlist-icon').attr('data-icon-label', data) 49 } 50 setTimeout(function () { 51 jQuery('i.wishlist-icon').removeClass('added') 52 }, 500) 53 }, 54 55 url: yith_wcwl_l10n.ajax_url, 56 }) 57 } 58 59 jQuery('body').on('added_to_wishlist removed_from_wishlist', flatsomeAddToWishlist) 60})
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.