Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle component tree recursively with alt key pressed #265

Merged
merged 1 commit into from
Feb 20, 2017
Merged

Toggle component tree recursively with alt key pressed #265

merged 1 commit into from
Feb 20, 2017

Conversation

bartlomieju
Copy link
Contributor

Once application grows, it becomes irritating to have to click component by component to expand the tree. Following Chrome's convention (as pointed by @kaleb) I added support for toggling the tree recursively if 'alt' key is pressed during toggle.

I also think it's high time for 'Settings' tab to be able to customize Devtool's behaviour. E.g. for example I'd like to start with component tree fully expanded but I guess I'll just submit Feature request

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

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

just some style changes

@@ -14,7 +14,7 @@
<!-- arrow wrapper for better hit box -->
<span class="arrow-wrapper"
v-if="instance.children.length"
@click.stop="toggle()">
@click.stop="toggle($event)">
Copy link
Member

Choose a reason for hiding this comment

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

the event is passed implicitly. You can just remove the ()

this.$store.dispatch('components/toggleInstance', {
instance: this.instance,
expanded: val,
recursive: recursive
Copy link
Member

Choose a reason for hiding this comment

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

simply recursive would do

@@ -30,8 +30,25 @@ const mutations = {
}
}

const actions = {
toggleInstance ({commit, dispatch}, {instance, expanded, recursive}) {
commit('TOGGLE_INSTANCE', {id: instance.id, expanded: expanded})
Copy link
Member

Choose a reason for hiding this comment

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

simply expanded would do

instance.children.forEach((child) => {
dispatch('toggleInstance', {
instance: child,
expanded: expanded,
Copy link
Member

Choose a reason for hiding this comment

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

same as others

@bartlomieju
Copy link
Contributor Author

bartlomieju commented Feb 19, 2017

@posva I updated to conform to your requests and force pushed to not pollute history with unnecessary commits :) hope it's all okay now

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

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

ping @yyx990803

@yyx990803 yyx990803 merged commit d8d8cd6 into vuejs:master Feb 20, 2017
@yyx990803
Copy link
Member

Thanks!

@bartlomieju bartlomieju deleted the toggle_recursively branch February 20, 2017 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants