Page 1 of 1

Specific rules in the folding/unfolding action (author mode)

Posted: Wed Sep 26, 2012 8:36 pm
by Vincent
Hi,


Concerning folding elements, you provide those actions :
  • Close Other Folds (Ctrl+NumPad+/) - Folds all the elements except the current element.
  • Collapse Child Folds (Ctrl+Decimal) - Folds the elements indented with one level inside the current element.
  • Expand Child Folds (Ctrl+Equals)- Unfolds all child elements of the currently selected element.
  • Expand All (Ctrl+NumPad+*) - Unfolds all elements in the current document.
  • Toggle Fold - Toggles the state of the current fold.

Can we create (with a plugin for example) such actions with specific behavior ?



For example,

I have an XML tree like :

Code: Select all


<root>
<part1>
<elementA>text</elementA>
<elementB>text</elementB>
<elementC>text</elementC>
<elementD>text</elementD>
</part1>
<part2>
<elementA>text</elementA>
<elementB>text</elementB>
<elementC>text</elementC>
<elementD>text</elementD>
</part2>
</root>
What can I do for creating a button that folds/unfolds all the elements A and D (in author mode).
(The rules concerning the folding/unfolding can be tricky, the key is to be able to control your unfolding action)


Thank you,


Vincent.

Re: Specific rules in the folding/unfolding action (author mode)

Posted: Thu Sep 27, 2012 11:44 am
by Radu
Hi Vincent,

Could you elaborate a little bit on the use case? It would help me to see the bug picture.
From what I understand you have already declared in the CSS that the elementA and elementD tags are foldable.
You just need a way to fold/unfold nodes using our API instead of having the user click the fold icons, right?
We do not yet have API to fold/unfold specific elements. Should we try to add the API to fold/unfold a specific AuthorNode?
How about if you try to hide the node completely using the CSS "display:none" property?

Regards,
Radu

Re: Specific rules in the folding/unfolding action (author mode)

Posted: Tue Oct 02, 2012 11:27 pm
by Vincent
Radu, Thank you for your answer.


We are aware that this is not so simple and we understand that it's not yet in the API. That's why, for this point, we are going to try to adapt our process with your existing functionality.
Having this feature would have brought more freedom, but it may be fine with another approach.



I'll let you know.


Vincent.

Re: Specific rules in the folding/unfolding action (author mode)

Posted: Wed Oct 03, 2012 9:19 am
by Radu
Hello Vincent,

We will try to add API for folding/unfolding elements and I'll update this thread when this happens.

Regards,
Radu