mirror of https://github.com/Lissy93/dashy.git
🔀 Merge pull request #1043 from m42e/xkcd-show-alt
XKCD: Use tooltip for alt text
This commit is contained in:
commit
a5f3c20810
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="xkcd-wrapper">
|
<div class="xkcd-wrapper" v-tooltip="toolTip(alt)">
|
||||||
<h3 class="xkcd-title">{{ title }}</h3>
|
<h3 class="xkcd-title">{{ title }}</h3>
|
||||||
<a :href="`https://xkcd.com/${comicNum}/`">
|
<a :href="`https://xkcd.com/${comicNum}/`">
|
||||||
<img :src="image" :alt="alt" class="xkcd-comic" />
|
<img :src="image" :alt="alt" class="xkcd-comic"/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -59,6 +59,12 @@ export default {
|
||||||
this.alt = data.alt;
|
this.alt = data.alt;
|
||||||
this.comicNum = data.num;
|
this.comicNum = data.num;
|
||||||
},
|
},
|
||||||
|
toolTip(alt) {
|
||||||
|
const content = alt;
|
||||||
|
return {
|
||||||
|
content, html: false, trigger: 'hover focus', delay: 250, classes: 'xkcd-alt-tt',
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -80,3 +86,8 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
<style lang="scss">
|
||||||
|
.xkcd-alt-tt {
|
||||||
|
min-width: 20rem;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue