1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-24 06:59:52 +01:00

vueui: made breadcrumbs nicer; added zoom-out icons and hover over helpful info/text

This commit is contained in:
Ivan Velev 2021-09-20 21:00:20 -07:00
parent f0cc5d73a6
commit 044e21b182
4 changed files with 50 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -2,11 +2,16 @@
<div class="breadcrumbs"> <div class="breadcrumbs">
<template v-if="parents.length"> <template v-if="parents.length">
<span class="item"> <span class="item">
<span class="goto" @click="changePeriod(parents[0])">{{parents[0].getReadableId(true)}}</span> <span class="goto" @click="changePeriod(parents[0])" :title="getPeriodZoomOutText(parents[0])">
<img src="/static/zoom-out-icon-333316.png" /> {{parents[0].getReadableId(true)}}
</span>
</span> </span>
&gt; &gt;
<span v-for="(parent,i) in parents" :key="parent.id" class="item" v-if="i > 0"> <span v-for="(parent,i) in parents" :key="parent.id" class="item" v-if="i > 0">
<span class="goto" @click="changePeriod(parent)">{{parent.getReadableId(true)}}</span> <span class="goto" @click="changePeriod(parent)" :title="getPeriodZoomOutText(parent)">
{{parent.getReadableId(true)}}
</span>
&gt;
</span> </span>
</template> </template>
<span class="item"> <span class="item">
@ -29,6 +34,9 @@ export default {
} }
}, },
methods: { methods: {
getPeriodZoomOutText(period) {
return 'Zoom out to '+period.getReadableId(true)+ ' ('+period.snapshotCount+' captures)';
},
changePeriod(period) { changePeriod(period) {
if (period.snapshotCount) { if (period.snapshotCount) {
this.$emit("goto-period", period); this.$emit("goto-period", period);
@ -52,22 +60,22 @@ export default {
vertical-align: middle; vertical-align: middle;
font-size: inherit; font-size: inherit;
} }
.breadcrumbs .count .verbose {
display: none;
}
.breadcrumbs .count:hover .verbose {
display: inline;
}
.breadcrumbs .item .goto { .breadcrumbs .item .goto {
display: inline-block;
margin: 1px; margin: 1px;
cursor: pointer; padding: 1px;
color: darkslateblue; cursor: zoom-out;
text-decoration: underline; border-radius: 5px;
background-color: #eeeeee;
} }
.breadcrumbs .item .goto:hover { .breadcrumbs .item .goto:hover {
background-color: #a6cdf5; background-color: #a6cdf5;
} }
.breadcrumbs .item .goto img {
height: 15px;
}
.breadcrumbs .item.snapshot { .breadcrumbs .item.snapshot {
display: block; display: block;
} }