complete edit function of editor.