angular-ui/bootstrap — pull request #1036 by caitp (2013-09-19 20:18:59+00:00)
Title: Support querying width/height of 'hidden' elements in $position

To avoid being too wordy: collapse.js needs to be able to query the height of invisible (collapsed) elements. Previous hack involved removing `.collapse` and re-adding it after. This is not a very good solution (although it is probably the least verbose).

jQuery provides a swapping mechanism here, which allows the height/width of hidden elements to be shown
https://github.com/jquery/jquery/blob/94ae7133449b2d0f5aab7e1a7f7190be65924145/src/css.js#L349

I propose adding height/width helpers to $position (and perhaps, just wrapping jQuery if jQuery is present), removing them from collapse.js (in #934 / #1001).

Additionally, it might be helpful to provide this behaviour for `$position.offset` as well, but I'm not sure.

- Pros: Lets me shrink down #934 / #1001 and avoid duplicating some code which is already present in $position.
- Cons: Makes library slightly bigger .___. (but very slightly!)