position toolbar based on text selection not mouse position, improve toolbar clear function