on master help sign in
Display sidebar selection even in term
commit847734cbeaa751185b119d56dd08d696f43a2fb9 authorDevine Lu Linvega <aliceffekt@gmail.com> dateMon 29 Jul 2019, 10:33 (7 years ago) parentc8ebf17
1 file changed+6−3
scripts/wiki.js+6−3
scripts/wiki.js+6−3
@@ -65,7 +65,7 @@ function Wiki (sites) {
6565 }
6666
6767 this.at = (q = '') => {
68− return this.loc.toUpperCase() === q.toUpperCase()
68+ return this.loc.toUpperCase() === q.toUpperCase() || this.cat(this.loc).toUpperCase() === q.toUpperCase()
6969 }
7070
7171 this.random = () => {
@@ -75,8 +75,11 @@ function Wiki (sites) {
7575 }
7676
7777 this.related = (name) => {
78− const cat = this.byName[name][0].cat
79− return this.byCat[cat]
78+ return this.byCat[this.cat(name)]
79+ }
80+
81+ this.cat = (name) => {
82+ return this.byName[name] ? this.byName[name][0].cat : ''
8083 }
8184
8285 this.templateRelated = (name, entry) => {