Function that will toggle the behaviour to close submenu when clicking the body
The id of the Submenu element
Whether a click outside the submenu closes it
the API response envelope as a JSON string: { code, isSuccess, message, value? }
{ code, isSuccess, message, value? }
Function that will toggle the behaviour to close submenu when clicking the body