The reason $(@el).height is reset before doing the calculation is because if you are dynamically setting the "content" of the content pane you will read the scrollheight of the previous content because it might have a height=xxx set on it already. 

Clearing the height will make $(@el) go back to auto height, then you can find the height on the content div properly.  It's just a rest.