Adds callback and configuration to the close on clickout functionality.