Fix firefox editmode javascript bug