diff --git a/css/base.css b/css/base.css index 7c3b8cc..4ef4975 100644 --- a/css/base.css +++ b/css/base.css @@ -170,6 +170,10 @@ sup.\~critical, .text-critical { font-size: 0.8rem; } +.inv-profilearea { + min-width: 20%; +} + .inv-profileselect { min-width: 100%; } diff --git a/ts/modules/invites.ts b/ts/modules/invites.ts index abe31aa..bd73222 100644 --- a/ts/modules/invites.ts +++ b/ts/modules/invites.ts @@ -270,30 +270,37 @@ export class DOMInvite implements Invite { this._left = document.createElement('div') as HTMLDivElement; detailsInner.appendChild(this._left); this._left.classList.add("inv-profilearea"); - this._left.innerHTML = ` + let innerHTML = `

Profile

-

Notify on:

- - `; + if (window.notificationsEnabled) { + innerHTML += ` +

Notify on:

+ + + `; + } + this._left.innerHTML = innerHTML; (this._left.querySelector("select") as HTMLSelectElement).onchange = this.updateProfile; + + if (window.notificationsEnabled) { + const notifyExpiry = this._left.querySelector("input.inv-notify-expiry") as HTMLInputElement; + notifyExpiry.onchange = () => { this._notifyExpiry = notifyExpiry.checked; this.updateNotify(notifyExpiry); }; - const notifyExpiry = this._left.querySelector("input.inv-notify-expiry") as HTMLInputElement; - notifyExpiry.onchange = () => { this._notifyExpiry = notifyExpiry.checked; this.updateNotify(notifyExpiry); }; - - const notifyCreation = this._left.querySelector("input.inv-notify-creation") as HTMLInputElement; - notifyCreation.onchange = () => { this._notifyCreation = notifyCreation.checked; this.updateNotify(notifyCreation); }; + const notifyCreation = this._left.querySelector("input.inv-notify-creation") as HTMLInputElement; + notifyCreation.onchange = () => { this._notifyCreation = notifyCreation.checked; this.updateNotify(notifyCreation); }; + } this._middle = document.createElement('div') as HTMLDivElement; detailsInner.appendChild(this._middle); @@ -322,8 +329,10 @@ export class DOMInvite implements Invite { this.created = invite.created; this.email = invite.email; this.expiresIn = invite.expiresIn; - this.notifyCreation = invite.notifyCreation; - this.notifyExpiry = invite.notifyExpiry; + if (window.notificationsEnabled) { + this.notifyCreation = invite.notifyCreation; + this.notifyExpiry = invite.notifyExpiry; + } this.profile = invite.profile; this.remainingUses = invite.remainingUses; this.usedBy = invite.usedBy;