marinofaggiana 4 éve
szülő
commit
84c63ada67

+ 32 - 32
iOSClient/Main/Menu/NCCollectionViewCommon+Menu.swift

@@ -121,6 +121,38 @@ extension NCCollectionViewCommon {
             )
         )
         
+        //
+        // OFFLINE
+        //
+        if !isFolderEncrypted {
+            actions.append(
+                NCMenuAction(
+                    title: isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") :  NSLocalizedString("_set_available_offline_", comment: ""),
+                    icon: UIImage(named: "offline")!.image(color: NCBrandColor.shared.icon, size: 50),
+                    action: { menuAction in
+                        if isOffline {
+                            if metadata.directory {
+                                NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: false, account: self.appDelegate.account)
+                            } else {
+                                NCManageDatabase.shared.setLocalFile(ocId: metadata.ocId, offline: false)
+                            }
+                        } else {
+                            if metadata.directory {
+                                NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: true, account: self.appDelegate.account)
+                                NCOperationQueue.shared.synchronizationMetadata(metadata, selector: NCBrandGlobal.shared.selectorDownloadAllFile)
+                            } else {
+                                NCNetworking.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
+                                if let metadataLivePhoto = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
+                                    NCNetworking.shared.download(metadata: metadataLivePhoto, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
+                                }
+                            }
+                        }
+                        self.reloadDataSource()
+                    }
+                )
+            )
+        }
+        
         //
         // DETAIL
         //
@@ -202,38 +234,6 @@ extension NCCollectionViewCommon {
             )
         }
         
-        //
-        // OFFLINE
-        //
-        if !isFolderEncrypted {
-            actions.append(
-                NCMenuAction(
-                    title: isOffline ? NSLocalizedString("_remove_available_offline_", comment: "") :  NSLocalizedString("_set_available_offline_", comment: ""),
-                    icon: UIImage(named: "offline")!.image(color: NCBrandColor.shared.icon, size: 50),
-                    action: { menuAction in
-                        if isOffline {
-                            if metadata.directory {
-                                NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: false, account: self.appDelegate.account)
-                            } else {
-                                NCManageDatabase.shared.setLocalFile(ocId: metadata.ocId, offline: false)
-                            }
-                        } else {
-                            if metadata.directory {
-                                NCManageDatabase.shared.setDirectory(serverUrl: serverUrl, offline: true, account: self.appDelegate.account)
-                                NCOperationQueue.shared.synchronizationMetadata(metadata, selector: NCBrandGlobal.shared.selectorDownloadAllFile)
-                            } else {
-                                NCNetworking.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
-                                if let metadataLivePhoto = NCManageDatabase.shared.getMetadataLivePhoto(metadata: metadata) {
-                                    NCNetworking.shared.download(metadata: metadataLivePhoto, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
-                                }
-                            }
-                        }
-                        self.reloadDataSource()
-                    }
-                )
-            )
-        }
-        
         //
         // OPEN IN
         //

+ 20 - 20
iOSClient/Main/Menu/NCViewer+Menu.swift

@@ -81,6 +81,26 @@ extension NCViewer {
             )
         )
         
+        //
+        // OFFLINE
+        //
+        if metadata.session == "" && !webView {
+            actions.append(
+                NCMenuAction(
+                    title: titleOffline,
+                    icon: UIImage(named: "offline")!.image(color: NCBrandColor.shared.icon, size: 50),
+                    action: { menuAction in
+                        if ((localFile == nil || !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView)) && metadata.session == "") {
+                            
+                            NCNetworking.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
+                        } else {
+                            NCManageDatabase.shared.setLocalFile(ocId: metadata.ocId, offline: !localFile!.offline)
+                        }
+                    }
+                )
+            )
+        }
+        
         //
         // DETAIL
         //
@@ -176,26 +196,6 @@ extension NCViewer {
             }
         }
         
-        //
-        // OFFLINE
-        //
-        if metadata.session == "" && !webView {
-            actions.append(
-                NCMenuAction(
-                    title: titleOffline,
-                    icon: UIImage(named: "offline")!.image(color: NCBrandColor.shared.icon, size: 50),
-                    action: { menuAction in
-                        if ((localFile == nil || !CCUtility.fileProviderStorageExists(metadata.ocId, fileNameView: metadata.fileNameView)) && metadata.session == "") {
-                            
-                            NCNetworking.shared.download(metadata: metadata, selector: NCBrandGlobal.shared.selectorLoadOffline) { (_) in }
-                        } else {
-                            NCManageDatabase.shared.setLocalFile(ocId: metadata.ocId, offline: !localFile!.offline)
-                        }
-                    }
-                )
-            )
-        }
-        
         //
         // OPEN IN
         //