docs($window): move use of $window to controller

Move use of $window from expression to controller, because accessing
$window in expressions is now dissalowed and doesn't work.