symfony-cmf / tree-browser-bundle

Integrates javascript tree browser with PHPCR and PHPCR-ODM.
https://cmf.symfony.com
Other
22 stars 17 forks source link

Add option to disable activating nodes #132

Closed wouterj closed 7 years ago

wouterj commented 7 years ago

Related: https://github.com/sonata-project/SonataDoctrinePhpcrAdminBundle/issues/383

ElectricMaxxx commented 7 years ago

I wouldn't be able to solve that issue with the information. The linked issue is talking about showing the menu when clicking on a node. The title here speaks about an option to activate a node.

ElectricMaxxx commented 7 years ago

For me it sounds like activating menu on click or right click based an on option?

wouterj commented 7 years ago

When clicking a node in the tree block (not tree form type), the node is activated. However, activating doesn't make any sense in the tree block. Instead of activating, nothing should happen.

ElectricMaxxx commented 7 years ago

Two more questions then:

That activation event is only used/registered for input fields. From my code understanding the block does not register the event.

The linked issue is saying something about the context menu, which is an different event then and only usefull for block.

wouterj commented 7 years ago

Ok, let me try to explain it one time more :)

When you visit http://sandbox.cmf.symfony.com/en/admin/dashboard and click a node in the tree shown, it will get blue. This act of becoming blue (and remaining blue) is called activating. This activating doesn't mean anything on the dashboard (or any other case using the tree block). Instead of activating, we can do 2 things on left click:

  1. Show the context menu (so left & right click behave the same)
  2. Do nothing

I propose to do (2).

ElectricMaxxx commented 7 years ago

When doing (2) we would catch and ignore the event only. I could live with that, but the issue in SonataPhpcrAdminBundle requests for a clear behavior. I can live with both, but we should not offer the menu on click and contextmeneu. I would suggest an option passed from configuration, which to use. When it is not on click we should disable activation then. Doing so, users can have both, the option and configurarion would not hurt.

wouterj commented 7 years ago

@ElectricMaxxx I'm against making simple behaviour like this configurable. It doesn't hurt anyone if we're going with (1) or (2), so we should just pick one and implement it.

dbu commented 7 years ago

i would also vote against 1. that leaves us open if we want something to happen in the future, like showing a summary or preview for example.

could it make sense to expand the tree when clicking on a folder node? so i don't need to hit exactly on the (+) thing...

is there drag and drop moving of nodes in the tree? that would be another reason to not do things on left click.

wouterj commented 7 years ago

is there drag and drop moving of nodes in the tree? that would be another reason to not do things on left click.

Working on that atm (see #99 )

ElectricMaxxx commented 7 years ago

Ok. So i will do (2) tonight.