fix: toc load on iPad

This commit is contained in:
Chris Li 2016-10-01 14:59:39 -04:00
parent 6dc2ae01c8
commit 49f64ca16f
5 changed files with 11 additions and 3 deletions

View File

@ -189,6 +189,11 @@ class MainController: UIViewController {
}
}
func configureTableOfContents() {
guard traitCollection.horizontalSizeClass == .Regular && isShowingTableOfContents else {return}
tableOfContentsController?.headings = JSInjection.getTableOfContents(webView)
}
func configureUserActivity() {
userActivity = userActivity ?? NSUserActivity(activityType: activityType)
guard let title = article?.title, let url = article?.url?.absoluteString else {return}

View File

@ -50,6 +50,7 @@ extension MainController: UIWebViewDelegate, SFSafariViewControllerDelegate, LPT
// UI Updates
configureNavigationButtonTint()
configureTableOfContents()
JSInjection.adjustFontSizeIfNeeded(webView)
}

View File

@ -115,8 +115,10 @@ extension MainController {
dimView.hidden = false
dimView.alpha = 0.0
view.layoutIfNeeded()
tableOfContentsController?.headings = JSInjection.getTableOfContents(webView)
configureTableOfContents()
configureTOCViewConstraints()
UIView.animateWithDuration(0.3, delay: 0.0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0.0, options: .CurveEaseOut, animations: {
self.view.layoutIfNeeded()
self.dimView.alpha = 0.5

View File

@ -49,7 +49,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.8.1549</string>
<string>1.8.1550</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSRequiresIPhoneOS</key>

View File

@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.8.1549</string>
<string>1.8.1550</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionMainStoryboard</key>