浏览代码

added `hideUploadButton` flag to hide the upload button, for cases when you want to manually stat the upload

Artur Paikin 7 年之前
父节点
当前提交
00257e5348
共有 3 个文件被更改,包括 4 次插入1 次删除
  1. 1 0
      examples/bundled-example/main.js
  2. 1 1
      src/plugins/Dashboard/Dashboard.js
  3. 2 0
      src/plugins/Dashboard/index.js

+ 1 - 0
examples/bundled-example/main.js

@@ -55,6 +55,7 @@ const uppy = Uppy({
     setMetaFromTargetForm: true,
     // replaceTargetContent: true,
     target: '.MyForm',
+    hideUploadButton: true,
     locale: {
       strings: {browse: 'wow'}
     },

+ 1 - 1
src/plugins/Dashboard/Dashboard.js

@@ -116,7 +116,7 @@ module.exports = function Dashboard (props) {
           })}
 
           <div class="UppyDashboard-actions">
-            ${!props.autoProceed && props.newFiles.length > 0
+            ${!props.hideUploadButton && !props.autoProceed && props.newFiles.length > 0
               ? UploadBtn({
                 i18n: props.i18n,
                 startUpload: props.startUpload,

+ 2 - 0
src/plugins/Dashboard/index.js

@@ -49,6 +49,7 @@ module.exports = class DashboardUI extends Plugin {
       semiTransparent: false,
       defaultTabIcon: defaultTabIcon(),
       showProgressDetails: false,
+      hideUploadButton: false,
       note: false,
       locale: defaultLocale
     }
@@ -359,6 +360,7 @@ module.exports = class DashboardUI extends Plugin {
       activePanel: state.modal.activePanel,
       progressindicators: progressindicators,
       autoProceed: this.core.opts.autoProceed,
+      hideUploadButton: this.opts.hideUploadButton,
       id: this.id,
       hideModal: this.hideModal,
       showProgressDetails: this.opts.showProgressDetails,