I just fixed indentation here and removed `var doc = event.originalTarget;`

(Sorry, that other comment ended up on my fork. I'm not even sure if you can see it)