I was wondering how would be the best way of doing this.
I have a list of elements that have children that will be expanded when one of those elements is clicked. There’s a button that will toggle all the elements to expand/compress their children. I have achieved all this but there’s something missed that is to recognize when all the children are expanded/compressed so I can rename the button to do what is needed, instead of, for example, show “expand all” when all are expanded and do nothing when the user clicks it.
Here’s a twiddle with the example: http://ember-twiddle.com/a7b33f6335ef68d05168
Maybe the approach I’m using is not the right one and there is a more elegant way of achieving this. Any suggestion will be appreciated