From f8020d877bc35aa339264d7aab951e68ed0789cb Mon Sep 17 00:00:00 2001 From: Artur Paikin Date: Wed, 19 Sep 2018 19:13:52 -0400 Subject: [PATCH] add commented parent.hideAllPanels call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit in case we need to manually close Dashboard panels, we now have a `this.parent` propety on Plugins, which means we can do `this.uppy.getPlugin(this.parent)` instead of `this.uppy.getPlugin('Dashboard')` — no need to know plugin id, see https://github.com/transloadit/uppy/issues/1057 --- packages/@uppy/webcam/src/index.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/@uppy/webcam/src/index.js b/packages/@uppy/webcam/src/index.js index 4883d721c..cb8299022 100644 --- a/packages/@uppy/webcam/src/index.js +++ b/packages/@uppy/webcam/src/index.js @@ -183,8 +183,13 @@ module.exports = class Webcam extends Plugin { .then(() => { this.recordingChunks = null this.recorder = null - const dashboard = this.uppy.getPlugin('Dashboard') - if (dashboard) dashboard.hideAllPanels() + + // Close the Dashboard panel if plugin is installed + // into Dashboard (could be other parent UI plugin) + // const parent = this.uppy.getPlugin(this.parent) + // if (parent && parent.hideAllPanels) { + // parent.hideAllPanels() + // } }, (error) => { this.recordingChunks = null this.recorder = null @@ -242,8 +247,12 @@ module.exports = class Webcam extends Plugin { return this.getImage() }).then((tagFile) => { this.captureInProgress = false - const dashboard = this.uppy.getPlugin('Dashboard') - if (dashboard) dashboard.hideAllPanels() + // Close the Dashboard panel if plugin is installed + // into Dashboard (could be other parent UI plugin) + // const parent = this.uppy.getPlugin(this.parent) + // if (parent && parent.hideAllPanels) { + // parent.hideAllPanels() + // } try { this.uppy.addFile(tagFile) } catch (err) {