Fixed failure with dynamically populated content

This fixes the issue where when the content was dynamically populated (i.e. the ui-layout directive is inside an ng-if directive), the sizes would be incorrect. It however will reset the sizes when the window is resized, but that is a lesser evil than not correctly display the layout in the first case.