calculate the actual sidebar height (including hidden submenus) and activate affix only if sidebar is smaller than window height. If higher expand all items if screen size is larger than 900