Task #WP-1327: fixed javascript errors that prevented popup from closing