Working javascript for edit with larger box translation