Эх сурвалжийг харах

Important modify (load / reload) view detail

marinofaggiana 5 жил өмнө
parent
commit
d78f637e88

+ 2 - 0
iOSClient/Main/CCDetail.h

@@ -40,6 +40,8 @@
 @property (nonatomic, strong) tableMetadata *metadataDetail;
 @property (nonatomic, strong) NSDate *dateFilterQuery;
 
+- (void)viewFile;
+
 // Toolbar
 @property (nonatomic, strong) UIToolbar *toolbar;
 

+ 6 - 15
iOSClient/Main/CCDetail.m

@@ -97,6 +97,11 @@
     // TabBar
     self.tabBarController.tabBar.hidden = YES;
     self.tabBarController.tabBar.translucent = YES;
+    
+    // Open View
+    if ([self.metadataDetail.fileNameView length] > 0 || [self.metadataDetail.serverUrl length] > 0 || [self.metadataDetail.fileID length] > 0) {        
+        [self viewFile];
+    }
 }
 
 - (void)viewWillAppear:(BOOL)animated
@@ -105,13 +110,6 @@
     
     self.tabBarController.tabBar.hidden = YES;
     self.tabBarController.tabBar.translucent = YES;
-    
-    // Open View
-    if ([self.metadataDetail.fileNameView length] > 0 || [self.metadataDetail.serverUrl length] > 0 || [self.metadataDetail.fileID length] > 0) {
-        
-        // open view
-        [self viewFile];
-    }
 }
 
 - (void)viewWillDisappear:(BOOL)animated
@@ -183,7 +181,7 @@
     //}
     
     // Title
-    self.navigationController.navigationBar.topItem.title =  _metadataDetail.fileNameView;
+    self.navigationController.navigationBar.topItem.title = _metadataDetail.fileNameView;
 
     // verifico se esiste l'icona e se la posso creare
     if ([[NSFileManager defaultManager] fileExistsAtPath:[CCUtility getDirectoryProviderStorageIconFileID:self.metadataDetail.fileID fileNameView:self.metadataDetail.fileNameView]] == NO) {
@@ -228,13 +226,6 @@
         // RichDocument
         if ([[NCUtility sharedInstance] isRichDocument:self.metadataDetail] && appDelegate.reachability.isReachable) {
             
-            // if is open do not reload
-            if (self.richDocument.metadata.fileID == self.metadataDetail.fileID) {
-                if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
-                    [self.navigationController setNavigationBarHidden:true];
-                return;
-            }
-            
             [[NCUtility sharedInstance] startActivityIndicatorWithView:self.view bottom:0];
             
             if ([self.metadataDetail.url isEqualToString:@""]) {

+ 4 - 0
iOSClient/Text/NCText.swift

@@ -109,6 +109,10 @@ class NCText: UIViewController, UITextViewDelegate {
         }
     }
     
+    override func viewDidDisappear(_ animated: Bool) {
+        appDelegate.activeDetail?.viewFile()
+    }
+    
     @objc func keyboardWillHideHandle() {
         bottomConstraint.constant = 0
     }