1
0
mirror of https://github.com/webrecorder/pywb.git synced 2025-03-15 00:03:28 +01:00

added fullId to v-for loops for safety of rendering and default unique IDs value to fullId in model; researched and tested showing multiple collections on same timeline;

This commit is contained in:
Ivan Velev 2022-02-04 14:55:45 -08:00
parent 718112884f
commit aae96b57bb
2 changed files with 3 additions and 3 deletions

View File

@ -19,14 +19,14 @@
<div class="scroll" ref="periodScroll" :class="{highlight: highlight}">
<div class="periods" ref="periods">
<div v-for="subPeriod in period.children"
:key="subPeriod.id"
:key="subPeriod.fullId"
class="period"
:class="{empty: !subPeriod.snapshotCount, highlight: highlightPeriod === subPeriod, 'last-level': !canZoom, 'contains-current-snapshot': containsCurrentSnapshot(subPeriod) }"
>
<div class="histo">
<div class="line"
v-for="histoPeriod in subPeriod.children"
:key="histoPeriod.id"
:key="histoPeriod.fullId"
:style="{height: getHistoLineHeight(histoPeriod.snapshotCount)}"
:class="{'has-single-snapshot': histoPeriod.snapshotCount === 1, 'contains-current-snapshot': containsCurrentSnapshot(histoPeriod)}"
@click="changePeriod(histoPeriod, $event)"

View File

@ -140,7 +140,7 @@ export class PywbSnapshot {
export function PywbPeriod(init) {
this.type = init.type;
this.id = init.id;
this.fullId = ''; // full-id property that include string id of parents and self with a delimitor
this.fullId = Math.floor(1000*1000+Math.random()*9*1000*1000).toString(16); // full-id property that include string id of parents and self with a delimitor
this.childrenIds = {}; // allow for query by ID
this.children = []; // allow for sequentiality / order