From dc8b6aa86c14269e80079bec25a7a9dcc080e781 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sun, 11 Mar 2012 15:29:55 +0100 Subject: [PATCH] Help text update for type. [FIXED] MP-12: Help doesn't always properly update for element type. --- MasterPassword/iOS/MPMainViewController.m | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index f7780166..93576aa5 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -221,14 +221,17 @@ [NSURLRequest requestWithURL: [NSURL URLWithString:[NSString stringWithFormat:@"#%@", chapter] relativeToURL: [[NSBundle mainBundle] URLForResource:@"help" withExtension:@"html"]]]]; - - NSString *error = [self.helpView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setClass('%@');", - ClassNameFromMPElementType(self.activeElement.type)]]; - if (error.length) - err(@"setClass: %@", error); }); } +- (void)webViewDidFinishLoad:(UIWebView *)webView { + + NSString *error = [self.helpView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"setClass('%@');", + ClassNameFromMPElementType(self.activeElement.type)]]; + if (error.length) + err(@"helpView.setClass: %@", error); +} + - (void)showContentTip:(NSString *)message withIcon:(UIImageView *)icon { dispatch_async(dispatch_get_main_queue(), ^{