Position widget relative to appended container

I was having problems with using this widget inside a bootstrap modal. Since `.modal-content` scrolls overflowing content, and the widget is absolutely positioned, it gets cut off if it would hang over the bottom.

This patch calculates the offset of the target element relative to the chosen `appendWidgetTo` container, and positions the widget accordingly.