Moved edit click handler logic from js to html