Improve expand/collapse logic
Improve expand/collapse logic

cernbox/core,pollopolea/core,sharidas/core,Ardinis/server,nextcloud/server,jbicha/server,owncloud/core,endsguy/server,IljaN/core,cernbox/core,pmattern/server,xx621998xx/server,andreas-p/nextcloud-server,IljaN/core,jbicha/server,michaelletzgus/nextcloud-server,IljaN/core,andreas-p/nextcloud-server,sharidas/core,pixelipo/server,michaelletzgus/nextcloud-server,michaelletzgus/nextcloud-server,sharidas/core,andreas-p/nextcloud-server,pmattern/server,jbicha/server,michaelletzgus/nextcloud-server,lrytz/core,whitekiba/server,nextcloud/server,andreas-p/nextcloud-server,cernbox/core,Ardinis/server,pollopolea/core,jbicha/server,IljaN/core,lrytz/core,lrytz/core,pollopolea/core,phil-davis/core,cernbox/core,pmattern/server,xx621998xx/server,pollopolea/core,lrytz/core,pixelipo/server,jbicha/server,whitekiba/server,bluelml/core,cernbox/core,sharidas/core,nextcloud/server,pollopolea/core,endsguy/server,owncloud/core,Ardinis/server,owncloud/core,pixelipo/server,xx621998xx/server,endsguy/server,bluelml/core,owncloud/core,xx621998xx/server,endsguy/server,andreas-p/nextcloud-server,pixelipo/server,bluelml/core,lrytz/core,whitekiba/server,Ardinis/server,sharidas/core,owncloud/core,pmattern/server,xx621998xx/server,nextcloud/server,pmattern/server,endsguy/server,bluelml/core,pixelipo/server,bluelml/core,whitekiba/server,Ardinis/server,IljaN/core,whitekiba/server