View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0019164 | MMW 5 | Extensions framework | public | 2022-06-10 22:14 | 2022-09-03 05:38 |
Reporter | zvezdan | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | feedback | Resolution | reopened | ||
Summary | 0019164: isVisible method for nodes needed | ||||
Description | isVisible 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. | ||||
Tags | No tags attached. | ||||
Fixed in build | |||||
|
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? |
|
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. |
|
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. |
|
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 |
|
|
|
And also see /sampleScripts/customNodes scripts to see how to add/remove custom nodes. |
|
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. |
|
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. |
|
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. |