Restore the timeline selection lost while transitioning to three panel mode
This commit is contained in:
parent
2b17735cb0
commit
bceccd76b5
|
@ -145,6 +145,13 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
|||
|
||||
// MARK: API
|
||||
|
||||
func restoreSelectionIfNecessary() {
|
||||
if let articleID = coordinator.currentArticle?.articleID, let index = coordinator.indexForArticleID(articleID) {
|
||||
let indexPath = IndexPath(row: index, section: 0)
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false, deselect: coordinator.isRootSplitCollapsed)
|
||||
}
|
||||
}
|
||||
|
||||
func reinitializeArticles() {
|
||||
resetUI()
|
||||
}
|
||||
|
@ -527,13 +534,6 @@ private extension MasterTimelineViewController {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func restoreSelectionIfNecessary() {
|
||||
if let articleID = coordinator.currentArticle?.articleID, let index = coordinator.indexForArticleID(articleID) {
|
||||
let indexPath = IndexPath(row: index, section: 0)
|
||||
tableView.selectRowAndScrollIfNotVisible(at: indexPath, animated: false, deselect: coordinator.isRootSplitCollapsed)
|
||||
}
|
||||
}
|
||||
|
||||
func toggleArticleReadStatusAction(indexPath: IndexPath) -> UIAction {
|
||||
let article = coordinator.articles[indexPath.row]
|
||||
|
|
|
@ -1620,6 +1620,8 @@ private extension SceneCoordinator {
|
|||
let navController = addNavControllerIfNecessary(controller, showButton: false)
|
||||
subSplitViewController!.showDetailViewController(navController, sender: self)
|
||||
|
||||
masterTimelineViewController!.restoreSelectionIfNecessary()
|
||||
|
||||
// Return the shim controller
|
||||
return subSplitViewController!.parent!
|
||||
|
||||
|
|
Loading…
Reference in New Issue