Fix the onResize event which doesn't work.

Revert "Fix onResize function to get around A is not a function error."