Implemented fix Added error handling to popover check. by chrismatthieu and fixed the resulting error Uncaught TypeError: Cannot call method 'contains' of undefined