Found a way to make the edit controls show and hide correctly. Tested locally, not on the server. Hopefully it will work.