discourse-adplugin/assets/javascripts/discourse/helpers/slot-position.js

16 lines
372 B
JavaScript
Raw Normal View History

export function isNthPost(every, currentPostNumber) {
if (every && every > 0) {
return currentPostNumber % every === 0;
} else {
return false;
}
}
export function isNthTopicListItem(every, currentIndexPosition) {
if (every && every > 0 && currentIndexPosition > 0) {
return (currentIndexPosition + 1) % every === 0;
} else {
return false;
}
}