Fixed a method in javascript for the editor.