mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
vue ui: fixed model "contains" in situation when checking if it contains a snapshot
This commit is contained in:
parent
fa317deeb4
commit
eae6a2e3d1
File diff suppressed because one or more lines are too long
@ -331,10 +331,14 @@ PywbPeriod.prototype.contains = function(periodOrSnapshot) {
|
|||||||
return true; // all-time contains everything
|
return true; // all-time contains everything
|
||||||
}
|
}
|
||||||
if (periodOrSnapshot instanceof PywbPeriod) {
|
if (periodOrSnapshot instanceof PywbPeriod) {
|
||||||
return periodOrSnapshot.getParents(true).slice(0,this.type).join(PywbPeriodIdDelimiter) === this.fullId;
|
return periodOrSnapshot.getParents(true).slice(0,this.type).map(p => p.id).join(PywbPeriodIdDelimiter) === this.fullId;
|
||||||
}
|
}
|
||||||
if (periodOrSnapshot instanceof PywbSnapshot) {
|
if (periodOrSnapshot instanceof PywbSnapshot) {
|
||||||
return periodOrSnapshot.getParentIds(true).slice(0,this.type).join(PywbPeriodIdDelimiter) === this.fullId;
|
if (this.type === PywbPeriod.Type.snapshot) {
|
||||||
|
return periodOrSnapshot.getFullId() === this.fullId;
|
||||||
|
} else {
|
||||||
|
return periodOrSnapshot.getParentIds(true).slice(0,this.type).join(PywbPeriodIdDelimiter) === this.fullId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user