PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.7.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.7.0
2.7.0 2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 All 43 releases
sellkit / assets / dist / js / promotion-banner.js

promotion-banner.js in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 2.7.0, at assets/dist/js/promotion-banner.js

68 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2 "use strict";
3
4 /**
5 * Promotion Banner dismiss functionality.
6 *
7 */
8 (function ($, settings) {
9 'use strict';
10
11 if (!settings || !settings.ajaxUrl) {
12 return;
13 }
14
15 $(function () {
16 var $banners = $('.sellkit-promotion-banner[data-sellkit-promotion-id]');
17
18 if (!$banners.length) {
19 return;
20 }
21 /**
22 * Send AJAX request to dismiss a promotion banner.
23 *
24 * @param {HTMLElement} bannerEl The banner element.
25 */
26
27
28 var sendDismiss = function sendDismiss(bannerEl) {
29 var $banner = $(bannerEl);
30 var promotionId = $banner.data('sellkit-promotion-id');
31 var nonce = $banner.data('sellkit-promotion-nonce');
32
33 if (!promotionId || !nonce) {
34 return;
35 }
36
37 $.ajax({
38 url: settings.ajaxUrl,
39 type: 'POST',
40 data: {
41 action: 'sellkit_dismiss_admin_promotion',
42 promotionId: promotionId,
43 nonce: nonce
44 }
45 });
46 };
47
48 $banners.each(function () {
49 var $banner = $(this);
50 var $dismissBtn = $banner.find('.sellkit-promotion-banner__dismiss');
51
52 if (!$dismissBtn.length) {
53 return;
54 }
55
56 $dismissBtn.on('click', function (event) {
57 event.preventDefault();
58 $banner.fadeOut(200, function () {
59 $banner.remove();
60 });
61 sendDismiss($banner[0]);
62 });
63 });
64 });
65 })(window.jQuery, window.sellkitPromotionBanner || {});
66
67 },{}]},{},[1]);
68