Move all segment editor event handlers to single function and allow segment editor html to be recreated.