Correct minor bug in onResize function

Minor fix that prevents the "[A] is not a function" error on FF, Chrome and others.