collection fixes:

- default to pages tab if story not available
- fix location bar
This commit is contained in:
Ilya Kreymer
2020-08-29 17:26:59 -07:00
parent e580a63e7e
commit 910e4795a5
4 changed files with 13 additions and 11 deletions
+8 -6
View File
@@ -198,6 +198,10 @@ class Coll extends LitElement
...this.tabData, view
};
}
if (!this.hasStory && this.tabData.view === "story") {
this.tabData.view = "pages";
}
}
onTabClick(event) {
@@ -646,21 +650,19 @@ class Coll extends LitElement
}
navigateTo(value) {
if (value.startsWith("http://") || value.startsWith("https://")) {
this.url = value;
this._replaceLoc = !this._locUpdateNeeded;
this._locUpdateNeeded = true;
let data;
if (value.startsWith("http://") || value.startsWith("https://")) {
data = {url: value, view: "replay"};
} else {
let data;
if (!value.startsWith(RWP_SCHEME)) {
data = {query: value, view: "pages"};
} else {
data = this._stringToParams(value);
}
//this.dispatchEvent(new CustomEvent("coll-tab-nav", {detail: {replaceLoc: false, data}}));
this.updateTabData(data);
}
this.updateTabData(data);
}
_stringToParams(value) {