‘; if (totalVotes > 10)
pollCount.classList.remove(“hidden”);
}
function trackBetsTodayPollImpression() {
var intersectionObserverForArticlePoll = new IntersectionObserver(
function(entries) {
entries.forEach(function(entry)
var pollId = entry.target.getAttribute(“data-poll-id”);
if (POLLS_BY_ID[pollId][‘impression_tracked’]) return;
if (!entry.target
function getRatingCountByPostId(postId) {
return new Promise(function(resolve, reject)
pureJSAjaxGet(
getRatingCountBaseURL + postId + ‘/rating/count’,
function(data)
try
data = JSON.parse(data);
if (data.meta_value)
resolve(data.meta_value);
reject(“Failed to fetch rating count for the post:” + postId);
catch (err)
reject(“Failed to fetch rating count for the post:” + postId);
,
function(err)
reject(“Failed to fetch rating count for the post:” + postId);
, true);
);
}
function showErrorMessage(messageType)
var messageContainerId = ‘#’ + messageType + ‘-error’;
$(messageContainerId).classList.remove(‘hidden’);
window.setInterval(function ()
$(messageContainerId).classList.add(“hidden”);
, 5000);
(function() {
var callFired = false;
function lazyLoadPostRating() {
if (callFired) return;
callFired = true;
if (!isPostRatedByUser()) {
getRatingCountByPostId(1783470)
.then(function(ratingCount) {
if (ratingCount