mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
RoomParticipantsViewController: Add possibility to display cancel bar button.
This commit is contained in:
parent
258a27ba2d
commit
4d415bbc02
2 changed files with 16 additions and 1 deletions
|
@ -84,6 +84,8 @@
|
|||
*/
|
||||
@property (nonatomic) BOOL enableMention;
|
||||
|
||||
@property (nonatomic) BOOL showCancelBarButtonItem;
|
||||
|
||||
/**
|
||||
The delegate for the view controller.
|
||||
*/
|
||||
|
|
|
@ -520,7 +520,15 @@
|
|||
// Check whether the view controller is currently displayed inside a segmented view controller or not.
|
||||
UIViewController* topViewController = ((self.parentViewController) ? self.parentViewController : self);
|
||||
topViewController.navigationItem.rightBarButtonItem = nil;
|
||||
topViewController.navigationItem.leftBarButtonItem = nil;
|
||||
|
||||
if (self.showCancelBarButtonItem)
|
||||
{
|
||||
topViewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(onCancel:)];
|
||||
}
|
||||
else
|
||||
{
|
||||
topViewController.navigationItem.leftBarButtonItem = nil;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onAddParticipantButtonPressed
|
||||
|
@ -1463,6 +1471,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
- (void)onCancel:(id)sender
|
||||
{
|
||||
[self withdrawViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
- (void)didSelectInvitableContact:(MXKContact*)contact
|
||||
|
|
Loading…
Reference in a new issue