Procházet zdrojové kódy

Core and Dashboard minor formatting

Artur Paikin před 7 roky
rodič
revize
4b492a4cba
2 změnil soubory, kde provedl 5 přidání a 7 odebrání
  1. 5 3
      src/core/Core.js
  2. 0 4
      src/plugins/Dashboard/index.js

+ 5 - 3
src/core/Core.js

@@ -279,7 +279,7 @@ class Uppy {
   _checkMinNumberOfFiles () {
   _checkMinNumberOfFiles () {
     const {minNumberOfFiles} = this.opts.restrictions
     const {minNumberOfFiles} = this.opts.restrictions
     if (Object.keys(this.getState().files).length < minNumberOfFiles) {
     if (Object.keys(this.getState().files).length < minNumberOfFiles) {
-      this.info(`${this.i18n('youHaveToAtLeastSelectX', {smart_count: minNumberOfFiles})}`, 'error', 5000)
+      this.info(`${this.i18n('youHaveToAtLeastSelectX', { smart_count: minNumberOfFiles })}`, 'error', 5000)
       return false
       return false
     }
     }
     return true
     return true
@@ -298,7 +298,7 @@ class Uppy {
 
 
     if (maxNumberOfFiles) {
     if (maxNumberOfFiles) {
       if (Object.keys(this.getState().files).length + 1 > maxNumberOfFiles) {
       if (Object.keys(this.getState().files).length + 1 > maxNumberOfFiles) {
-        this.info(`${this.i18n('youCanOnlyUploadX', {smart_count: maxNumberOfFiles})}`, 'error', 5000)
+        this.info(`${this.i18n('youCanOnlyUploadX', { smart_count: maxNumberOfFiles })}`, 'error', 5000)
         return false
         return false
       }
       }
     }
     }
@@ -384,7 +384,9 @@ class Uppy {
         }
         }
 
 
         const isFileAllowed = this._checkRestrictions(newFile)
         const isFileAllowed = this._checkRestrictions(newFile)
-        if (!isFileAllowed) return Promise.reject(new Error('File not allowed'))
+        if (!isFileAllowed) {
+          return Promise.reject(new Error('File not allowed'))
+        }
 
 
         updatedFiles[fileID] = newFile
         updatedFiles[fileID] = newFile
         this.setState({files: updatedFiles})
         this.setState({files: updatedFiles})

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

@@ -226,9 +226,7 @@ module.exports = class Dashboard extends Plugin {
     })
     })
 
 
     document.body.classList.remove('uppy-Dashboard-isOpen')
     document.body.classList.remove('uppy-Dashboard-isOpen')
-
     this.savedActiveElement.focus()
     this.savedActiveElement.focus()
-
     window.scrollTo(0, this.savedScrollPosition)
     window.scrollTo(0, this.savedScrollPosition)
   }
   }
 
 
@@ -319,9 +317,7 @@ module.exports = class Dashboard extends Plugin {
     }
     }
 
 
     this.removeDragDropListener()
     this.removeDragDropListener()
-
     this.uppy.off('dashboard:file-card', this.handleFileCard)
     this.uppy.off('dashboard:file-card', this.handleFileCard)
-
     window.removeEventListener('resize', this.updateDashboardElWidth)
     window.removeEventListener('resize', this.updateDashboardElWidth)
   }
   }