release/3.0: [#8449] fix broken javascript in IE7

http://www.redmine.org/issues/13811

This is cherry-picked from this revision:
Fix errors mentioned by JSHint.
https://github.com/opf/openproject/pull/1405

https://github.com/opf/openproject/pull/1414#issuecomment-44976775