post-hover-tree.js: small refactor