Feat: Updated hookup method for GitHub contributions calendar with new element structure
This commit is contained in:
@@ -234,7 +234,7 @@ function hookupProjectDetailButtons() {
|
|||||||
function hookupGitHubContributionsCalendar() {
|
function hookupGitHubContributionsCalendar() {
|
||||||
// Basic implementation
|
// Basic implementation
|
||||||
// e - statistics are all 0
|
// e - statistics are all 0
|
||||||
GitHubCalendar(".github-calendar", "Teddy-1024");
|
// GitHubCalendar(".github-calendar", "Teddy-1024");
|
||||||
|
|
||||||
// Or with responsive option enabled:
|
// Or with responsive option enabled:
|
||||||
// e - statistics are all 0
|
// e - statistics are all 0
|
||||||
@@ -252,6 +252,26 @@ function hookupGitHubContributionsCalendar() {
|
|||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
new Promise((resolve) => {
|
||||||
|
GitHubCalendar(".github-calendar", "Teddy-1024");
|
||||||
|
|
||||||
|
const checkLoaded = () => {
|
||||||
|
const calendar = document.querySelector('.github-calendar .js-calendar-graph-table');
|
||||||
|
if (calendar) {
|
||||||
|
resolve();
|
||||||
|
} else {
|
||||||
|
setTimeout(checkLoaded, 100);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
checkLoaded();
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
const scrollableElement = document.querySelector('.github-calendar .js-calendar-graph-table');
|
||||||
|
scrollableElement.scrollLeft = scrollableElement.scrollWidth - scrollableElement.clientWidth;
|
||||||
|
})
|
||||||
|
;
|
||||||
|
/*
|
||||||
const scrollableElement = document.querySelector('.github-calendar .js-calendar-graph-table');
|
const scrollableElement = document.querySelector('.github-calendar .js-calendar-graph-table');
|
||||||
scrollableElement.scrollLeft = scrollableElement.scrollWidth - scrollableElement.clientWidth;
|
scrollableElement.scrollLeft = scrollableElement.scrollWidth - scrollableElement.clientWidth;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user