From 37367cde652f50ed4bb04d72ee9e8a0e2f74a6dd Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 26 May 2021 16:11:49 +0530 Subject: [PATCH] Make close button close the view Signed-off-by: RMidhunSuresh --- src/domain/session/rightpanel/RoomInfoViewModel.js | 4 ++++ src/platform/web/ui/session/rightpanel/RoomInfoView.js | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/domain/session/rightpanel/RoomInfoViewModel.js b/src/domain/session/rightpanel/RoomInfoViewModel.js index a2b7eaf4..c74ae826 100644 --- a/src/domain/session/rightpanel/RoomInfoViewModel.js +++ b/src/domain/session/rightpanel/RoomInfoViewModel.js @@ -39,4 +39,8 @@ export class RoomInfoViewModel extends ViewModel { get avatarTitle() { return this.name; } + + get closeLink() { + return this.urlCreator.urlUntilSegment("room"); + } } diff --git a/src/platform/web/ui/session/rightpanel/RoomInfoView.js b/src/platform/web/ui/session/rightpanel/RoomInfoView.js index 57190e7c..04520602 100644 --- a/src/platform/web/ui/session/rightpanel/RoomInfoView.js +++ b/src/platform/web/ui/session/rightpanel/RoomInfoView.js @@ -8,7 +8,7 @@ export class RoomInfoView extends TemplateView { const encryptionString = vm.isEncrypted ? "On" : "Off"; return t.div({ className: "RoomInfo" }, [ - this._createButton(), + this._createButton(vm), t.div({ className: "RoomAvatar" }, [t.view(new AvatarView(vm, 52)), this._createEncryptionIcon(vm.isEncrypted)]), t.div({ className: "RoomName" }, [t.h2(vm.name)]), @@ -32,7 +32,8 @@ export class RoomInfoView extends TemplateView { [tag.div({ className: isEncrypted ? "encrypted" : "unencrypted" })]) } - _createButton() { - return tag.div({ className: "buttons" }, [tag.div({ className: "close button-utility" })]); + _createButton(vm) { + return tag.div({ className: "buttons" }, + [tag.a({ className: "close button-utility", href: vm.closeLink })]); } }