qb-pc-sdk 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core.min.js +1 -1
- package/package.json +2 -2
- package/src/ad-sdk-wrapper.js +22 -1
package/package.json
CHANGED
package/src/ad-sdk-wrapper.js
CHANGED
|
@@ -552,6 +552,24 @@
|
|
|
552
552
|
videoEl
|
|
553
553
|
].filter(Boolean);
|
|
554
554
|
|
|
555
|
+
(function() {
|
|
556
|
+
var lastAdClickTime = 0;
|
|
557
|
+
var debounceMs = 2000;
|
|
558
|
+
wrapper.addEventListener('click', function(e) {
|
|
559
|
+
if (e.target.closest('.q-ad-close-wrap')) return;
|
|
560
|
+
var now = Date.now();
|
|
561
|
+
if (lastAdClickTime && (now - lastAdClickTime < debounceMs)) {
|
|
562
|
+
e.preventDefault();
|
|
563
|
+
e.stopPropagation();
|
|
564
|
+
e.stopImmediatePropagation();
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
lastAdClickTime = now;
|
|
568
|
+
}, true);
|
|
569
|
+
})();
|
|
570
|
+
|
|
571
|
+
var lastOnClickTime = 0;
|
|
572
|
+
var onClickDebounceMs = 2000;
|
|
555
573
|
ad.bindAdToView({
|
|
556
574
|
containerView: wrapper,
|
|
557
575
|
clickableElements: clickable,
|
|
@@ -560,6 +578,9 @@
|
|
|
560
578
|
if (this.config.onAdExpose) this.config.onAdExpose();
|
|
561
579
|
},
|
|
562
580
|
onClick: () => {
|
|
581
|
+
var now = Date.now();
|
|
582
|
+
if (lastOnClickTime && (now - lastOnClickTime < onClickDebounceMs)) return;
|
|
583
|
+
lastOnClickTime = now;
|
|
563
584
|
if (this.config.onAdClick) this.config.onAdClick();
|
|
564
585
|
}
|
|
565
586
|
}
|
|
@@ -600,7 +621,7 @@
|
|
|
600
621
|
if (cta) {
|
|
601
622
|
try {
|
|
602
623
|
const ev = new MouseEvent('click', {
|
|
603
|
-
bubbles:
|
|
624
|
+
bubbles: false,
|
|
604
625
|
cancelable: true,
|
|
605
626
|
view: typeof window !== 'undefined' ? window : null
|
|
606
627
|
});
|