Tabs: Optimized onResize function