Fixed checkIfClose with ajax content

if closeOnContent is false and content has no wrapper element.