Code to switch the expansion button between open/close