Browse Source

use uppy-Root in status-bar when it’s mounted in DOM

similar to Dashboard
Artur Paikin 6 years ago
parent
commit
f5d6ab96e7

+ 1 - 1
packages/@uppy/status-bar/src/StatusBar.js

@@ -82,7 +82,7 @@ module.exports = (props) => {
                            ${progressMode ? 'is-' + progressMode : ''}`
                            ${progressMode ? 'is-' + progressMode : ''}`
 
 
   const statusBarClassNames = classNames(
   const statusBarClassNames = classNames(
-    'uppy',
+    { 'uppy-Root': props.isTargetDOMEl },
     'uppy-StatusBar',
     'uppy-StatusBar',
     `is-${uploadState}`,
     `is-${uploadState}`,
     { 'uppy-StatusBar--detailedProgress': props.showProgressDetails }
     { 'uppy-StatusBar--detailedProgress': props.showProgressDetails }

+ 2 - 1
packages/@uppy/status-bar/src/index.js

@@ -226,7 +226,8 @@ module.exports = class StatusBar extends Plugin {
       hideUploadButton: this.opts.hideUploadButton,
       hideUploadButton: this.opts.hideUploadButton,
       hideRetryButton: this.opts.hideRetryButton,
       hideRetryButton: this.opts.hideRetryButton,
       hidePauseResumeCancelButtons: this.opts.hidePauseResumeCancelButtons,
       hidePauseResumeCancelButtons: this.opts.hidePauseResumeCancelButtons,
-      hideAfterFinish: this.opts.hideAfterFinish
+      hideAfterFinish: this.opts.hideAfterFinish,
+      isTargetDOMEl: this.isTargetDOMEl
     })
     })
   }
   }
 
 

+ 2 - 2
website/src/examples/dragdrop/app.es6

@@ -6,13 +6,13 @@ const Tus = require('@uppy/tus')
 const uppyOne = new Uppy({debug: true, autoProceed: true})
 const uppyOne = new Uppy({debug: true, autoProceed: true})
 uppyOne
 uppyOne
   .use(DragDrop, {target: '.UppyDragDrop-One'})
   .use(DragDrop, {target: '.UppyDragDrop-One'})
-  .use(Tus, {endpoint: '//master.tus.io/files/'})
+  .use(Tus, {endpoint: 'https://master.tus.io/files/'})
   .use(ProgressBar, {target: '.UppyDragDrop-One-Progress', hideAfterFinish: false})
   .use(ProgressBar, {target: '.UppyDragDrop-One-Progress', hideAfterFinish: false})
 
 
 const uppyTwo = new Uppy({debug: true, autoProceed: false})
 const uppyTwo = new Uppy({debug: true, autoProceed: false})
 uppyTwo
 uppyTwo
   .use(DragDrop, {target: '#UppyDragDrop-Two'})
   .use(DragDrop, {target: '#UppyDragDrop-Two'})
-  .use(Tus, {endpoint: '//master.tus.io/files/'})
+  .use(Tus, {endpoint: 'https://master.tus.io/files/'})
   .use(ProgressBar, {target: '.UppyDragDrop-Two-Progress', hideAfterFinish: false})
   .use(ProgressBar, {target: '.UppyDragDrop-Two-Progress', hideAfterFinish: false})
 
 
 var uploadBtn = document.querySelector('.UppyDragDrop-Two-Upload')
 var uploadBtn = document.querySelector('.UppyDragDrop-Two-Upload')

+ 1 - 1
website/src/examples/i18n/app.html

@@ -19,7 +19,7 @@ https://transloadit.edgly.net/releases/uppy/v0.27.4/dist/uppy.min.js -->
     }
     }
   });
   });
   uppy.use(Uppy.ProgressBar, { target: 'body', fixed: true, hideAfterFinish: false });
   uppy.use(Uppy.ProgressBar, { target: 'body', fixed: true, hideAfterFinish: false });
-  uppy.use(Uppy.Tus, { endpoint: '//master.tus.io/files/' });
+  uppy.use(Uppy.Tus, { endpoint: 'https://master.tus.io/files/' });
 
 
   console.log('--> Uppy pre-built version with Tus, DragDrop & Russian language pack has loaded');
   console.log('--> Uppy pre-built version with Tus, DragDrop & Russian language pack has loaded');
 </script>
 </script>

+ 6 - 2
website/src/examples/statusbar/app.es6

@@ -6,5 +6,9 @@ const Tus = require('@uppy/tus')
 const uppyOne = new Uppy({debug: true, autoProceed: true})
 const uppyOne = new Uppy({debug: true, autoProceed: true})
 uppyOne
 uppyOne
   .use(FileInput, { target: '.UppyInput', pretty: false })
   .use(FileInput, { target: '.UppyInput', pretty: false })
-  .use(Tus, { endpoint: '//master.tus.io/files/' })
-  .use(StatusBar, { target: '.UppyInput-Progress', hideUploadButton: true })
+  .use(Tus, { endpoint: 'https://master.tus.io/files/' })
+  .use(StatusBar, {
+    target: '.UppyInput-Progress',
+    hideUploadButton: true,
+    hideAfterFinish: false
+  })