Recent pads improvements

This commit is contained in:
yflory
2019-05-03 15:07:04 +02:00
parent c9e53d9ab9
commit 5a19f7cc5d
6 changed files with 93 additions and 13 deletions

View File

@@ -636,7 +636,7 @@ define([
}
// If we have an edit link, check the view link
if (el.href && parsed.hashData.type === "pad") {
if (el.href && parsed.hashData.type === "pad" && parsed.hashData.version) {
if (parsed.hashData.mode === "view") {
el.roHref = el.href;
delete el.href;
@@ -651,6 +651,10 @@ define([
}
}
}
// v0 hashes don't support read-only
if (parsed.hashData.version === 0) {
delete el.roHref;
}
// Fix href
if (el.href && /^https*:\/\//.test(el.href)) { el.href = Hash.getRelativeHref(el.href); }