mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Calculate path when button is clicked
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
37e052c061
commit
b2448e1207
@ -44,7 +44,8 @@ export class RoomInfoViewModel extends ViewModel {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
get closeLink() {
|
||||
return this.urlCreator.urlUntilSegment("room");
|
||||
closePanel() {
|
||||
const path = this.navigation.path.until("room");
|
||||
this.navigation.applyPath(path);
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ export class RoomInfoView extends TemplateView {
|
||||
const encryptionString = vm.isEncrypted ? vm.i18n`On` : vm.i18n`Off`;
|
||||
|
||||
return t.div({ className: "RoomInfo" }, [
|
||||
this._createButton(vm),
|
||||
this._createButton(t, vm),
|
||||
t.div({ className: "RoomAvatar" },
|
||||
[t.view(new AvatarView(vm, 52)), this._createEncryptionIcon(vm.isEncrypted)]),
|
||||
t.div({ className: "RoomName" }, [t.h2(vm.name)]),
|
||||
@ -40,8 +40,10 @@ export class RoomInfoView extends TemplateView {
|
||||
[tag.div({ className: isEncrypted ? "encrypted" : "unencrypted" })])
|
||||
}
|
||||
|
||||
_createButton(vm) {
|
||||
return tag.div({ className: "buttons" },
|
||||
[tag.a({ className: "close button-utility", href: vm.closeLink })]);
|
||||
_createButton(t, vm) {
|
||||
return t.div({ className: "buttons" },
|
||||
[
|
||||
t.button({ className: "close button-utility", onClick: () => vm.closePanel() })
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user