瀏覽代碼

Enable button save only if available a template #753

Marino Faggiana 6 年之前
父節點
當前提交
59fc4b54e1
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      iOSClient/Main/Create cloud/NCCreateFormUploadRichdocuments.swift

+ 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
                 }
             }