Repaire javascript for edit view