Abstract out event handler

The implementation of the "pick attachment" functionality should not be
tied to any specific DOM event.
Implement positioning hack

This is not the way to solve this problem, but I'll file a separate bug
to fix it project-wide in the Building Blocks.
Add styling

Again, these changes belong in the project-wide Building Blocks.
Add test