mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:19:10 +00:00
REFACTOR: removes self pattern from safari-hacks lib (#7795)
This commit is contained in:
parent
e064db35d9
commit
c1ca942a77
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user