add(parentitem, rows) {
const catitem = put(parentitem, 'ul');
rows.forEach(ref => {
- const [title, level, imgid] = this.data[ref];
+ const [title, level, imgid, subs] = this.data[ref];
const worditem = put(catitem, 'li');
const figitem = put(worditem, 'figure');
if (imgid) {
innerHTML: html,
});
}
- let levelpart = level <= 1 && this.cats[ref] && this.cats[ref].length > 1;
- if (levelpart) {
+ if (level <= 1 && subs.length >= 2) {
put(worditem, '.large');
}
- if (this.cats[ref]) {
+ if (subs.length) {
// delve into subcategory
put(worditem, '.parent');
- this.add(worditem, this.cats[ref].sort((a, b) => {
- const [worda, wordb] = [this.data[a], this.data[b]];
- return (worda[1] % 1) - (wordb[1] % 1)
- || worda[0].localeCompare(wordb[0]);
- }));
+ this.add(worditem, subs);
}
});
}
setup() {
this.gallery = document.getElementById('gallery');
put(this.gallery, '-p', 'Under construction.');
- this.add(this.gallery, this.preset.cat ? [this.preset.cat] : this.cats[null]);
+ this.add(this.gallery, this.preset.cat ? [this.preset.cat] : this.data[''][3]);
}
stop() {}