Make table views scroll even if the root split is collapsed
This commit is contained in:
parent
5bfeb77706
commit
8b901819a6
|
@ -434,12 +434,9 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
|||
// MARK: API
|
||||
|
||||
func updateFeedSelection() {
|
||||
guard !coordinator.isRootSplitCollapsed else {
|
||||
return
|
||||
}
|
||||
if let indexPath = coordinator.currentFeedIndexPath {
|
||||
if tableView.indexPathForSelectedRow != indexPath {
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: true)
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: true, deselect: coordinator.isRootSplitCollapsed)
|
||||
}
|
||||
} else {
|
||||
tableView.selectRow(at: nil, animated: true, scrollPosition: .none)
|
||||
|
@ -665,11 +662,8 @@ private extension MasterFeedViewController {
|
|||
}
|
||||
|
||||
func restoreSelectionIfNecessary() {
|
||||
guard !coordinator.isRootSplitCollapsed else {
|
||||
return
|
||||
}
|
||||
if let indexPath = coordinator.masterFeedIndexPathForCurrentTimeline(), indexPath != tableView.indexPathForSelectedRow {
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false)
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false, deselect: coordinator.isRootSplitCollapsed)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -156,13 +156,9 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
|||
}
|
||||
|
||||
func updateArticleSelection(animate: Bool) {
|
||||
guard !coordinator.isRootSplitCollapsed && !coordinator.articles.isEmpty else {
|
||||
return
|
||||
}
|
||||
|
||||
if let indexPath = coordinator.currentArticleIndexPath {
|
||||
if tableView.indexPathForSelectedRow != indexPath {
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: true)
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: true, deselect: coordinator.isRootSplitCollapsed)
|
||||
}
|
||||
} else {
|
||||
tableView.selectRow(at: nil, animated: animate, scrollPosition: .none)
|
||||
|
@ -533,12 +529,9 @@ private extension MasterTimelineViewController {
|
|||
}
|
||||
|
||||
func restoreSelectionIfNecessary() {
|
||||
guard !coordinator.isRootSplitCollapsed else {
|
||||
return
|
||||
}
|
||||
if let articleID = coordinator.currentArticle?.articleID, let index = coordinator.indexForArticleID(articleID) {
|
||||
let indexPath = IndexPath(row: index, section: 0)
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false)
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false, deselect: coordinator.isRootSplitCollapsed)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 3e0dbb1c0a88697e7be510da0226fe1e3e7ef195
|
||||
Subproject commit 7af10d021f35df5596fa898ba55f5173fcb0e26b
|
Loading…
Reference in New Issue