Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Ensure that activating a DockItem shows the corresponding Dock #779

Merged
merged 2 commits into from
May 12, 2017

Conversation

BinaryMuse
Copy link
Contributor

#673 made it show the Dock items are shown on first launch; however, the right Dock defaults to closed. This changes it so when we activate the item, it also shows the Dock.

@BinaryMuse BinaryMuse requested a review from smashwilson May 10, 2017 22:58
@BinaryMuse
Copy link
Contributor Author

I feel like there must be a better way to do this. 😑

Copy link
Contributor

@smashwilson smashwilson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like there must be a better way to do this. 😑

Concur, but I couldn't find anything in the Workspace or Dock API to support it either. That probably indicates a gap in the API, yah?

@@ -109,6 +109,11 @@ export default class DockItem extends React.Component {
const pane = this.props.workspace.paneForItem(this.dockItem);
if (pane) {
pane.activateItem(this.dockItem);
const dock = this.props.workspace.getPaneContainers()
.find(container => container.getPanes().find(p => p.getItems().includes(this.dockItem)));
if (dock && dock.constructor.name === 'Dock') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to probe for the method directly rather than using the constructor name:

dock && dock.show && dock.show();

@BinaryMuse BinaryMuse merged commit 43d25fe into master May 12, 2017
@BinaryMuse BinaryMuse deleted the mkt-ensure-dock-open-on-first-run branch May 12, 2017 14:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants