Fix javascript event on ace editor