From c1ca942a774dd67abdba61a503ad8901ead2d3e6 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Mon, 24 Jun 2019 11:12:06 +0200 Subject: [PATCH] REFACTOR: removes self pattern from safari-hacks lib (#7795) --- app/assets/javascripts/discourse/lib/safari-hacks.js.es6 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 index 809adbf6ba3..b063a8094a5 100644 --- a/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 +++ b/app/assets/javascripts/discourse/lib/safari-hacks.js.es6 @@ -116,16 +116,15 @@ function positioningWorkaround($fixedElement) { var blurred = debounce(blurredNow, 250); var positioningHack = function(evt) { - const self = this; done = false; // we need this, otherwise changing focus means we never clear - self.addEventListener("blur", blurred); + this.addEventListener("blur", blurred); if (fixedElement.style.top === "0px") { if (this !== document.activeElement) { evt.preventDefault(); - self.focus(); + this.focus(); } return; } @@ -157,7 +156,7 @@ function positioningWorkaround($fixedElement) { $(fixedElement).addClass("no-transition"); evt.preventDefault(); - self.focus(); + this.focus(); workaroundActive = true; };