Dr0ptp4kt has submitted this change and it was merged.
Change subject: Entry in TOC for "Read more".
......................................................................
Entry in TOC for "Read more".
Change-Id: Ifd290cdf1865d700879b6d22dbaa7b9a6a92a127
---
M wikipedia/View Controllers/TableOfContents/TOCViewController.m
M wikipedia/View Controllers/WebView/WebViewController.m
2 files changed, 13 insertions(+), 0 deletions(-)
Approvals:
Dr0ptp4kt: Verified; Looks good to me, approved
Fjalapeno: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/wikipedia/View Controllers/TableOfContents/TOCViewController.m
b/wikipedia/View Controllers/TableOfContents/TOCViewController.m
index 0bb873c..f5c4f5e 100644
--- a/wikipedia/View Controllers/TableOfContents/TOCViewController.m
+++ b/wikipedia/View Controllers/TableOfContents/TOCViewController.m
@@ -609,6 +609,15 @@
[allSectionData addObject:sectionDict];
}
+
+ // Add "read more" item to end of TOC.
+ [allSectionData addObject:@{
+ @"id": @(100000),
+ @"isLead": @(NO),
+ @"level": @0,
+ @"title":
MWLocalizedString(@"article-read-more-title", @"Read more")
+ }];
+
self.tocSectionData = allSectionData;
[self refreshForCurrentArticle];
}
diff --git a/wikipedia/View Controllers/WebView/WebViewController.m
b/wikipedia/View Controllers/WebView/WebViewController.m
index 817aeab..5f17c4e 100644
--- a/wikipedia/View Controllers/WebView/WebViewController.m
+++ b/wikipedia/View Controllers/WebView/WebViewController.m
@@ -1573,6 +1573,10 @@
self.searchSuggestionsController.searchString = article.title.text;
[self.searchSuggestionsController search];
+
+ // Add target div for TOC "read more" entry so it can use existing
+ // TOC scrolling mechanism.
+ [sectionTextArray addObject:@"<div
id='section_heading_and_content_block_100000'></div>"];
}
// This is important! Ensures bottom of web view article can be scrolled
closer to the top of
--
To view, visit https://gerrit.wikimedia.org/r/193321
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd290cdf1865d700879b6d22dbaa7b9a6a92a127
Gerrit-PatchSet: 2
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mhurd <[email protected]>
Gerrit-Reviewer: Bgerstle <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Fjalapeno <[email protected]>
Gerrit-Reviewer: Mhurd <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits