iOS: Only display/respond to valid keyboard shortcuts (#826).

This commit is contained in:
Nicholas Riley 2015-11-24 13:52:16 -05:00
parent d64c66dd62
commit 52cfb516f0
2 changed files with 20 additions and 0 deletions

View file

@ -1941,6 +1941,12 @@ shouldStartLoadWithRequest:(NSURLRequest *)request
[requestOperation start];
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
if ([self respondsToSelector:action])
return self.noStoryMessage.hidden;
return [super canPerformAction:action withSender:sender];
}
# pragma mark
# pragma mark Subscribing to blurblog

View file

@ -1114,6 +1114,20 @@
[appDelegate.feedDetailViewController redrawUnreadStory]; // XXX only if successful?
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
if (action == @selector(toggleTextView:) ||
action == @selector(scrollPageDown:) ||
action == @selector(scrollPageUp:) ||
action == @selector(toggleStoryUnread:) ||
action == @selector(toggleStorySaved:) ||
action == @selector(showOriginalSubview:) ||
action == @selector(openShareDialog) ||
action == @selector(scrolltoComment)) {
return (currentPage.pageIndex >= 0);
}
return [super canPerformAction:action withSender:sender];
}
#pragma mark -
#pragma mark Styles