Implementing editor saving on focus lost