fix tree directive option overriding direction issue, and add view to open note detail