Close children submenu when closing submenu

Added script that makes sure any off canvas children submenus are
closed when a submenu is closed.