From b9d0cce08aaeaf23db91486921529586cf45b46e Mon Sep 17 00:00:00 2001 From: David Fischer Date: Thu, 4 Apr 2019 14:06:22 -0700 Subject: [PATCH] Fix for Firefox to close the ad correctly --- readthedocs/core/static-src/core/js/doc-embed/sponsorship.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js b/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js index 35879169d4a..8cc183d4511 100644 --- a/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js +++ b/readthedocs/core/static-src/core/js/doc-embed/sponsorship.js @@ -199,6 +199,9 @@ Promo.prototype.display = function () { $(window).on('DOMContentLoaded.rtdinview load.rtdinview scroll.rtdinview resize.rtdinview', handler); $('.wy-side-scroll').on('scroll.rtdinview', handler); + // Add a handler to close the ad on mobile + $('.ethical-close').on('click', function () { $(ad_selector).hide(); return false; }); + this.post_promo_display(); };