[Fix] 8449 Fix JS errors

[``* `#8449` Fix JavaScript errors for IE 8``](https://www.openproject.org/work_packages/8449)

These are errors listed by JSHint.