Fix popovers
Following @bnjbvr's report of regression in 1e6dfbe9:
First commit reverts the appendTo
modification. Both work fine to me but I figured this might be wanted? If not I'll just remove the commit.
Second commit hides the popovers when its reference is hidden, which can become the case when scrolling.
Third commit restricts the popopover boundaries to #app > main
instead of the document, so that it knows it cannot overflow the #app > header
for example.
Edited by Nicolas Frandeboeuf