mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 05:35:04 +08:00
Fix HeaderButtons handler bindings
This commit is contained in:
parent
bdfb77077a
commit
f28c396b1e
@ -41,8 +41,6 @@ interface IProps {}
|
||||
export default class GroupHeaderButtons extends HeaderButtons {
|
||||
constructor(props: IProps) {
|
||||
super(props, HeaderKind.Group);
|
||||
this.onMembersClicked = this.onMembersClicked.bind(this);
|
||||
this.onRoomsClicked = this.onRoomsClicked.bind(this);
|
||||
}
|
||||
|
||||
protected onAction(payload: ActionPayload) {
|
||||
@ -68,7 +66,7 @@ export default class GroupHeaderButtons extends HeaderButtons {
|
||||
}
|
||||
}
|
||||
|
||||
private onMembersClicked() {
|
||||
private onMembersClicked = () => {
|
||||
if (this.state.phase === RightPanelPhases.GroupMemberInfo) {
|
||||
// send the active phase to trigger a toggle
|
||||
this.setPhase(RightPanelPhases.GroupMemberInfo);
|
||||
@ -76,12 +74,12 @@ export default class GroupHeaderButtons extends HeaderButtons {
|
||||
// This toggles for us, if needed
|
||||
this.setPhase(RightPanelPhases.GroupMemberList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private onRoomsClicked() {
|
||||
private onRoomsClicked = () => {
|
||||
// This toggles for us, if needed
|
||||
this.setPhase(RightPanelPhases.GroupRoomList);
|
||||
}
|
||||
};
|
||||
|
||||
renderButtons() {
|
||||
return [
|
||||
|
@ -54,7 +54,7 @@ export default class RoomHeaderButtons extends HeaderButtons {
|
||||
}
|
||||
}
|
||||
|
||||
private onMembersClicked() {
|
||||
private onMembersClicked = () => {
|
||||
if (this.state.phase === RightPanelPhases.RoomMemberInfo) {
|
||||
// send the active phase to trigger a toggle
|
||||
// XXX: we should pass refireParams here but then it won't collapse as we desire it to
|
||||
@ -63,17 +63,17 @@ export default class RoomHeaderButtons extends HeaderButtons {
|
||||
// This toggles for us, if needed
|
||||
this.setPhase(RightPanelPhases.RoomMemberList);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private onFilesClicked() {
|
||||
private onFilesClicked = () => {
|
||||
// This toggles for us, if needed
|
||||
this.setPhase(RightPanelPhases.FilePanel);
|
||||
}
|
||||
};
|
||||
|
||||
private onNotificationsClicked() {
|
||||
private onNotificationsClicked = () => {
|
||||
// This toggles for us, if needed
|
||||
this.setPhase(RightPanelPhases.NotificationPanel);
|
||||
}
|
||||
};
|
||||
|
||||
public renderButtons() {
|
||||
return [
|
||||
|
Loading…
Reference in New Issue
Block a user