Prechádzať zdrojové kódy

Enable button save only if available a template #753

Marino Faggiana 6 rokov pred
rodič
commit
59fc4b54e1

+ 3 - 0
iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

@@ -68,6 +68,8 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
         self.navigationItem.leftBarButtonItem = cancelButton
         self.navigationItem.rightBarButtonItem = saveButton
 
+        self.navigationItem.rightBarButtonItem?.isEnabled = false
+        
         self.navigationController?.navigationBar.isTranslucent = false
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
         self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
@@ -297,6 +299,7 @@ class NCCreateFormUploadRichdocuments: XLFormViewController, NCSelectDelegate, U
                 if template.preview == "" {
                     self.selectTemplate = template
                     self.fileNameExtension = template.extension
+                    self.navigationItem.rightBarButtonItem?.isEnabled = true
                 }
             }