View Issue Details

IDProjectCategoryView StatusLast Update
0019164MMW 5Extensions frameworkpublic2022-09-03 05:38
Reporterzvezdan Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status feedbackResolutionreopened 
Summary0019164: isVisible method for nodes needed
DescriptionisVisible method should return true if a node is visible in the tree, i.e. all its parent nodes are expanded.

Yes, that could be easily programed in scripts, but it would be better if it is available as a built-in method.
TagsNo tags attached.
Fixed in build

Relationships

related to 0019165 resolvedLudek expandParents or makeVisible method for nodes needed 

Activities

Ludek

2022-06-13 13:17

developer   ~0068495

If a node isn't visible then it means that it even does not exist yet.
Node is created by expanding it's parent.

So not sure what exactly your are requesting and what's your use case?

zvezdan

2022-06-13 13:49

updater   ~0068496

Hm, it seems you are right. I am confusing nodes with views. For example, if I have turned off the "Focus tree nodes when browsing content" option, when I apply the navigate method of navigationHandlers I am getting a view on the specified nodePath, but the active node is not changed and the tree is not expanded. Which means that that nodePath is not visible, not node.

For example, with:
window.nodeUtils.getNodeByPath(window.currentTabControl.rootNode, [window.navUtils.createNodeState('root'), window.navUtils.createNodeState('collection', coll), window.navUtils.createNodeState('location', coll)], true)

I could get a view on the Location node, i.e. the content of that node is showed in the tracklist and its path is showed in the navigation bar. But the node itself is not visible with the mentioned "Focus.." option turned off.

zvezdan

2022-06-13 14:33

updater   ~0068501

I posted the wrong example. Here it the right one:
window.navUtils.navigateNodePath([window.navUtils.createNodeState('root'), window.navUtils.createNodeState('collection', collection), window.navUtils.createNodeState('location', collection)], true)

Could you please tell me if my status disallows me to edit my posts or I am just dumb to find that option? It seems that I could edit only the first post with which I opened the issue, but not other posts from the thread.

Ludek

2022-06-13 19:53

developer   ~0068506

Last edited: 2022-06-13 19:57

Yes, in MM5 nodes are not scrictly related to a single component. You can navigate nodes either via Media Tree, Breadscrumbs or node grids. i.e. Media Tree can be completelly disabled/hidden.

You can use navUtils.getActiveNode(); to get node of the active view and then use node.parent to get it's parent node etc.

If a visibility of a node should be changed then it is solved by re-reading its children list and add/remove the nodes no longer in the list.
e.g. see node handler Observable for example

Ludek

2022-06-13 19:57

developer   ~0068507

image.png (42,171 bytes)   
image.png (42,171 bytes)   

Ludek

2022-06-13 20:00

developer   ~0068508

And also see /sampleScripts/customNodes scripts to see how to add/remove custom nodes.

zvezdan

2022-06-13 20:19

updater   ~0068510

Yes, of course I know for navUtils.getActiveNode() and how to get its parents. Which is why I said that it "could be easily programed in scripts".

But I also said that it "would be better if it is available as a built-in method". You have some even more trivial methods already added to the API, like isLocalPath(), so why not this one as well.

Ludek

2022-09-02 10:26

developer   ~0069150

Last edited: 2022-09-02 10:26

OK, so can you elaborate what exactly you are asking for and an example / use-case?

As I wrote above, node is either visible or it simply does not exist, so isVisible property does not make sense here.

zvezdan

2022-09-03 05:38

updater   ~0069156

As I wrote above, you are wrong and I gave you one example with navigateNodePath when node exists, but is not visible. Here is another example:
- expand Entire Library node;
- select Location node;
- execute navUtils.getFocusedNode().title -> you will get 'Location';
- collapse Entire Library node;
- execute navUtils.getFocusedNode().title -> you will still get 'Location', i.e. node still exists, although it is not visible.

Anyway, never mind. Just forget my suggestion and close this issue. I will spend less time writing code for this method than arguing with you about it.