i Want to Find Where js is written for data-action="add-to-wish-list" in magento 2
i saw add-to-wish list data-action many times..
on research i found the action in
Mageto_Wishlit/js/addtowishlist.js
Here is a widget with two functions
bindFormSubmit: function () { var self = this; $('[data-action="add-to-wishlist"]').on('click', function (event) { var element, params, form, action; alert("Hi I am Here"); event.stopPropagation(); event.preventDefault(); element = $('input[type=file]' + self.options.customOptionsInfo); params = $(event.currentTarget).data('post'); form = $(element).closest('form'); action = params.action; if (params.data.id) { $('<input>', { type: 'hidden', name: 'id', value: params.data.id }).appendTo(form); } if (params.data.uenc) { action += 'uenc/' + params.data.uenc; } $(form).attr('action', action).submit(); }); }
And
_updateAddToWishlistButton: function (dataToAdd) { var self = this; $('[data-action="add-to-wishlist"]').each(function (index, element) { var params = $(element).data('post');alert("Hi I am Here"); if (!params) { params = { 'data': {} }; } params.data = $.extend({}, params.data, dataToAdd, { 'qty': $(self.options.qtyInfo).val() }); $(element).data('post', params); }); },
i have tried to interupt these two events by adding alert but i am not getting any success Need Help