on master help sign in
Display sidebar selection even in term
847734cDevine Lu Linvega
scripts/wiki.js+6−3
@@ -65,7 +65,7 @@ function Wiki (sites) {
65 }
65 }
66
66
67 this.at = (q = '') => {
67 this.at = (q = '') => {
68− return this.loc.toUpperCase() === q.toUpperCase()
68+ return this.loc.toUpperCase() === q.toUpperCase() || this.cat(this.loc).toUpperCase() === q.toUpperCase()
69 }
69 }
70
70
71 this.random = () => {
71 this.random = () => {
@@ -75,8 +75,11 @@ function Wiki (sites) {
75 }
75 }
76
76
77 this.related = (name) => {
77 this.related = (name) => {
78+ return this.byCat[this.cat(name)]
79+ }
80+
81+ this.cat = (name) => {
78− const cat = this.byName[name][0].cat
82+ return this.byName[name] ? this.byName[name][0].cat : ''
79− return this.byCat[cat]
80 }
83 }
81
84
82 this.templateRelated = (name, entry) => {
85 this.templateRelated = (name, entry) => {