in src/StrippetsVisual.ts [568:613]
private initializeOutlines(): any {
const t = this;
const Outlines = require('@uncharted/strippets');
const $outlines = t.outlines.$elem;
const outlinesInstance = new Outlines($outlines[0], {
outline: {
reader: {
enabled: true,
onLoadUrl: $.proxy(t.onLoadArticle, t),
onReaderOpened: (id) => {
t.lastOpenedStoryId = id;
},
onReaderClosed: () => {
t.lastOpenedStoryId = null;
},
onSourceUrlClicked: (href) => {
t.launchUrl && t.launchUrl(href);
},
},
enableExpandedMode: false,
},
autoGenerateIconMap: false,
supportKeyboardNavigation: false,
entityIcons: [],
}, t.mediator);
// set up infinite scroll
let infiniteScrollTimeoutId: any;
outlinesInstance.$viewport.on('scroll', (e) => {
if ($(e.target).width() + e.target.scrollLeft >= e.target.scrollWidth) {
infiniteScrollTimeoutId = setTimeout(() => {
clearTimeout(infiniteScrollTimeoutId);
if (!t.isLoadingMore && t.hasMoreData && t.loadMoreData) {
t.isLoadingMore = true;
t.showLoader();
t.loadMoreData();
}
}, t.INFINITE_SCROLL_DELAY);
}
});
// Register Click Event
outlinesInstance.$viewport.off('click');
return outlinesInstance;
}