Bug 983812 - Center header text based on amount of available space

I don't think reading window.innerWidth will generates reflows. Not sure you need the extra logic here, also this will break on orientation changes. I still not convinced that you need a method here instead of inlining var windowWidth = window.innerWidth inside the function that used it.