Skip to content

Commit

Permalink
fix: better menu display
Browse files Browse the repository at this point in the history
  • Loading branch information
FlickerSoul committed May 5, 2024
1 parent 992bae7 commit 8e74bea
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
40 changes: 26 additions & 14 deletions scripts/BrilTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,35 @@ export async function BrilTransformerFactory(bril: any, nord: any, rose: any): P
},
...Array.from(reachingDefLines)
.sort((a, b) => a - b)
.map((line, index) => {
.flatMap((line, index) => {
const targetId = generateId(this.options.lang, this.meta.transformRd, line)
const separator = index === reachingDefLines.size - 1 ? '' : ', '
return {
type: 'element',
tagName: 'a',
properties: {
'@click': generateClickCallback(targetId),
'class': ['cursor-pointer'],
},
children: [
<Text>{
type: 'text',
value: `${line}${separator}`,
return [
{
type: 'element',
tagName: 'a',
properties: {
'@click': generateClickCallback(targetId),
'class': ['cursor-pointer'],
},
],
}
children: [
<Text>{
type: 'text',
value: `${line}`,
},
],
},
{
type: 'element',
tagName: 'span',
children: [
{
type: 'text',
value: separator,
},
],
},
]
}),
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/Post.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ useHead({
<style lang="sass">
@import 'floating-vue/dist/style.css'
.v-popper__inner
padding: 0 0.5em
padding: 0.2em 0.7em
</style>

<style scoped lang="sass">
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const UseFloatingVue: Plugin<FloatingVueConfig> = {
delay: 0,
handleResize: false,
autoHide: true,
instantMove: true,
instantMove: false,
flip: false,
arrowPadding: 8,
autoBoundaryMaxSize: true,
Expand Down

0 comments on commit 8e74bea

Please sign in to comment.