fixes #5173 JS error when you editing News content

Fixed the issue and pushed the code for review, please check it.