diff --git a/src/domain/session/rightpanel/RoomDetailsViewModel.js b/src/domain/session/rightpanel/RoomDetailsViewModel.js index 896fab54..a2dff761 100644 --- a/src/domain/session/rightpanel/RoomDetailsViewModel.js +++ b/src/domain/session/rightpanel/RoomDetailsViewModel.js @@ -62,4 +62,11 @@ export class RoomDetailsViewModel extends ViewModel { super.dispose(); this._room.off("change", this._onRoomChange); } + + openPanel(segment) { + let path = this.navigation.path.until("room"); + path = path.with(this.navigation.segment("right-panel", true)); + path = path.with(this.navigation.segment(segment, true)); + this.navigation.applyPath(path); + } } diff --git a/src/platform/web/ui/session/rightpanel/RoomDetailsView.js b/src/platform/web/ui/session/rightpanel/RoomDetailsView.js index 8357b722..7e7fa363 100644 --- a/src/platform/web/ui/session/rightpanel/RoomDetailsView.js +++ b/src/platform/web/ui/session/rightpanel/RoomDetailsView.js @@ -16,7 +16,8 @@ export class RoomDetailsView extends TemplateView { this._createRoomAliasDisplay(vm), t.div({className: "RoomDetailsView_rows"}, [ - this._createRightPanelRow(t, vm.i18n`People`, {MemberCount: true}, vm => vm.memberCount), + this._createRightPanelButtonRow(t, vm.i18n`People`, { MemberCount: true }, vm => vm.memberCount, + () => vm.openPanel("members")), this._createRightPanelRow(t, vm.i18n`Encryption`, {EncryptionStatus: true}, encryptionString) ]) ]); @@ -35,6 +36,14 @@ export class RoomDetailsView extends TemplateView { ]); } + _createRightPanelButtonRow(t, label, labelClass, value, onClick) { + const labelClassString = classNames({RoomDetailsView_label: true, ...labelClass}); + return t.button({className: "RoomDetailsView_row", onClick}, [ + t.div({className: labelClassString}, [label]), + t.div({className: "RoomDetailsView_value"}, value) + ]); + } + _createButton(t, vm) { return t.div({className: "RoomDetailsView_buttons"}, [