sure $node could be a view (using a template as you suggest above), but it's so small it was easier to do it in place

the comment here is not about that however.  it is about wanting the "light-popup" menu (offering expand-all, collapse-all, etc) to appear if the user hovers for more than 500ms.  comment is noting there is no "hover-after-delay" mechanism out-of-the-box hence the setTimeout code beneath.