Fix javascript for add a related work. Fixes ndlib/planning#299