marinofaggiana 5 years ago
parent
commit
6be9d2f236
2 changed files with 21 additions and 0 deletions
  1. 15 0
      iOSClient/Viewer/NCViewerMedia.swift
  2. 6 0
      iOSClient/Viewer/NCViewerNextcloudText.swift

+ 15 - 0
iOSClient/Viewer/NCViewerMedia.swift

@@ -5,6 +5,21 @@
 //  Created by Marino Faggiana on 21/09/18.
 //  Copyright © 2018 Marino Faggiana. All rights reserved.
 //
+//  Author Marino Faggiana <marino.faggiana@nextcloud.com>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
 
 import Foundation
 import KTVHTTPCache

+ 6 - 0
iOSClient/Viewer/NCViewerNextcloudText.swift

@@ -103,6 +103,12 @@ class NCViewerNextcloudText: WKWebView, WKNavigationDelegate, WKScriptMessageHan
                 detail.navigationController?.popViewController(animated: true)
                 detail.navigationController?.navigationBar.topItem?.title = ""
                 
+                let splitViewController = appDelegate.window.rootViewController as! UISplitViewController
+                if splitViewController.isCollapsed {
+                    let masterNavigationController = splitViewController.viewControllers.first as! UINavigationController
+                    masterNavigationController.popViewController(animated: true)
+                }
+                                
                 appDelegate.activeMain.readFileReloadFolder()
             }