Make PopupProxy._frameOffsetExpireTimeout non-static (#640)

This commit is contained in:
toasted-nutbread 2020-07-03 11:58:52 -04:00 committed by GitHub
parent d776125ead
commit 562cfd7470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,6 +31,7 @@ class PopupProxy extends EventDispatcher {
this._frameOffset = null;
this._frameOffsetPromise = null;
this._frameOffsetUpdatedAt = null;
this._frameOffsetExpireTimeout = 1000;
}
// Public properties
@ -113,7 +114,7 @@ class PopupProxy extends EventDispatcher {
async _updateFrameOffset() {
const now = Date.now();
const firstRun = this._frameOffsetUpdatedAt === null;
const expired = firstRun || this._frameOffsetUpdatedAt < now - PopupProxy._frameOffsetExpireTimeout;
const expired = firstRun || this._frameOffsetUpdatedAt < now - this._frameOffsetExpireTimeout;
if (this._frameOffsetPromise === null && !expired) { return; }
if (this._frameOffsetPromise !== null) {
@ -151,5 +152,3 @@ class PopupProxy extends EventDispatcher {
return [x + offsetX, y + offsetY];
}
}
PopupProxy._frameOffsetExpireTimeout = 1000;