REFACTOR: removes self pattern from safari-hacks lib (#7795)

This commit is contained in:
Joffrey JAFFEUX 2019-06-24 11:12:06 +02:00 committed by GitHub
parent e064db35d9
commit c1ca942a77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
};