소스 검색

dashboard: set default trigger: null (#2942)

Artur Paikin 3 년 전
부모
커밋
b817e84e77
2개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 2
      packages/@uppy/dashboard/src/index.js
  2. 3 3
      website/src/docs/dashboard.md

+ 3 - 2
packages/@uppy/dashboard/src/index.js

@@ -120,7 +120,7 @@ module.exports = class Dashboard extends Plugin {
     const defaultOptions = {
       target: 'body',
       metaFields: [],
-      trigger: '#uppy-select-files',
+      trigger: null,
       inline: false,
       width: 750,
       height: 550,
@@ -500,7 +500,8 @@ module.exports = class Dashboard extends Plugin {
     clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)
   }
 
-  // Records whether we have been interacting with uppy right now, which is then used to determine whether state updates should trigger a refocusing.
+  // Records whether we have been interacting with uppy right now,
+  // which is then used to determine whether state updates should trigger a refocusing.
   recordIfFocusedOnUppyRecently = (event) => {
     if (this.el.contains(event.target)) {
       this.ifFocusedOnUppyRecently = true

+ 3 - 3
website/src/docs/dashboard.md

@@ -67,7 +67,7 @@ uppy.use(Dashboard, {
   id: 'Dashboard',
   target: 'body',
   metaFields: [],
-  trigger: '#uppy-select-files',
+  trigger: null,
   inline: false,
   width: 750,
   height: 550,
@@ -117,9 +117,9 @@ Dashboard is rendered into `body`, because it is hidden by default and only open
 
 By default, Dashboard will be rendered as a modal, which is opened by clicking on `trigger`. If `inline: true`, Dashboard will be rendered into `target` and fit right in.
 
-### `trigger: '#uppy-select-files'`
+### `trigger: null`
 
-String with a CSS selector for a button that will trigger opening the Dashboard modal. Multiple buttons or links can be used, as long as it is a class selector (`.uppy-choose`, for example).
+String with a CSS selector for a button that will trigger opening the Dashboard modal. Multiple buttons or links can be used, as long as it is a class selector (`.select-file-button`, for example).
 
 ### `plugins: []`