This fixed the problem reported by Brian, where the new view window popup when using the display template.
There are two similar logics used in this class, and I think this is the best place for this fixed
Merge remote-tracking branch 'origin/master'