can't we find another way to do this ? like just try to call mmsAttachmentClick on evt.target ?
If evt.target is not in the weakmap, it means it's not an attachment.

another way is to check if tagName matches /video|img|audio/