vkurko / calendar

Full-sized drag & drop JavaScript event calendar with resource & timeline views

Home Page:https://vkurko.github.io/calendar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setContact action improvement

stackasaur opened this issue · comments

All of the 'html' options use the setContact action defined in common. The action can handle either a string, or an object declaring html or domNodes, to render using innerHTML or appendChild respectively.

I believe passing in a DOM Node directly should be allowable. So rather than having to do

titleHTML: {
  domNodes:[el]
}

for a singular domNode, we should be able to just do

titleHTML:el

this would just require setContent to have another check

// isNode function to handle browser discrepancies 
function isNode(o){
  return (
    typeof Node === "object" ? o instanceof Node : 
    o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string"
  );
}
...
else if (isNode(content)){
  node.appendChild(content);
}
...

This is absolutely not needed, but I think it'd be a nice QOL improvement.

titleHTML: {
domNodes:[el]
}

This format is not supported for titleHTML. The only supported format is string.

You may be confusing this with the eventContent option. But in this case, the current format of input value seems quite convenient and sufficient to me.