Skip to content

Commit

Permalink
Merge branch 'master' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ckcherry23 committed Feb 6, 2024
2 parents 43df982 + 29903e3 commit 62581c2
Show file tree
Hide file tree
Showing 39 changed files with 529 additions and 396 deletions.
424 changes: 424 additions & 0 deletions frontend/src/components/c-authorship-file.vue

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions frontend/src/mixin/dynamicTooltipMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ import { defineComponent } from 'vue';
export default defineComponent({
methods: {
onTooltipHover(refName: string): void {
const tooltipTextElement = (this.$refs[refName] as HTMLElement[])[0];
const tooltipTextElement = this.getElementByRef(refName);
if (this.isElementAboveViewport(tooltipTextElement)) {
tooltipTextElement.classList.add('bottom-aligned');
}
},
resetTooltip(refName: string): void {
const tooltipTextElement = (this.$refs[refName] as HTMLElement[])[0];
const tooltipTextElement = this.getElementByRef(refName);
tooltipTextElement.classList.remove('bottom-aligned');
},
isElementAboveViewport(el: Element): boolean {
return el.getBoundingClientRect().top <= 0;
},
/**
* Note: this.$refs[refName] can be an array of HTMLElements
* if the ref is on a v-for loop, else it will be a single HTMLElement.
*/
getElementByRef(refName: string): HTMLElement {
return Array.isArray(this.$refs[refName])
? (this.$refs[refName] as HTMLElement[])[0]
: this.$refs[refName] as HTMLElement;
},
},
});
Loading

0 comments on commit 62581c2

Please sign in to comment.