docs: function (type, idx, defs, matchType) {
  					if (_p[type] && !_p[type].endpoint && !_p[type + "Endpoint"] && !_p.newConnection) {
  						var tid = _getId(_p[type]), tep = defs[tid];
  
  						tep = tep ? tep[matchType] : null;
  
  						if (tep) {
  							// if not enabled, return.
  							if (!tep.enabled) return false;
  							var newEndpoint = tep.endpoint != null && tep.endpoint._jsPlumb ? tep.endpoint : _addEndpoint(_p[type], tep.def, idx);
  							if (newEndpoint.isFull()) return false;
  							_p[type + "Endpoint"] = newEndpoint;
  							newEndpoint._doNotDeleteOnDetach = false; // reset.
  							newEndpoint._deleteOnDetach = true;
  							if (tep.uniqueEndpoint) {
  								if (!tep.endpoint) {
  									tep.endpoint = newEndpoint;
  									newEndpoint._deleteOnDetach = false;
  									newEndpoint._doNotDeleteOnDetach = true;
  								}
  								else
  									newEndpoint.finalEndpoint = tep.endpoint;
  							}
  						}
  					}
  				}