yalabot / angular-foundation

http://pineconellc.github.io/angular-foundation/
Other
1.05k stars 266 forks source link

position service does not include margin left of body when calculating tooltip offset #291

Open joshunger opened 8 years ago

joshunger commented 8 years ago

When you have a tooltip that is appended to the body (tooltip-append-to-body="1") the position service does not include the margin left of the body causing the offset and left to be incorrect.

Something like this fixes the issue for me -

offset.left = Math.round(offset.left - parseFloat(window.getComputedStyle(document.body).marginLeft));

Top might also need to be fixed.

The position service appears to be significantly out of date compared to the Angular UI Bootstrap position service. There might be other bug fixes already fixed in Angular UI Bootstrap that would be worth grabbing.