Fix #3373

(See http://stackoverflow.com/questions/25032539/magnificpopup-not-working-on-first-click-using-on)