bahai-indexes
Advanced tools
Comparing version 0.8.2 to 0.8.3
# CHANGES to `bahai-indexes` | ||
## 0.8.3 | ||
- fix: was not separating by book in multi-book view | ||
## 0.8.2 | ||
@@ -4,0 +8,0 @@ |
@@ -149,14 +149,19 @@ /* eslint-disable no-unsanitized/property -- Source must be trusted as | ||
const ul = document.createElement('ul'); | ||
let bookUl; | ||
const bookUl = book ? null : document.createElement('ul'); | ||
const visited = {}; | ||
results.forEach((result) => { | ||
if (!book) { | ||
bookUl = document.createElement('ul'); | ||
let bookUlInner; | ||
if (!book && !visited[result.$book]) { | ||
const bookLi = document.createElement('li'); | ||
const bold = document.createElement('b'); | ||
bookUlInner = document.createElement('ul'); | ||
bold.textContent = `[${result.$book}]`; | ||
bookLi.append(bold); | ||
bookLi.append(ul); | ||
bookLi.append(bookUlInner); | ||
bookUl.append(bookLi); | ||
resultsHolder.append(bookUl); | ||
visited[result.$book] = true; | ||
} | ||
traverse(result, ul, (obj, parent) => { | ||
traverse(result, bookUlInner || ul, (obj, parent) => { | ||
const li = document.createElement('li'); | ||
@@ -182,3 +187,3 @@ li.innerHTML = obj.$text; | ||
resultsHolder.append(bookUl || ul); | ||
if (!bookUl) resultsHolder.append(ul); | ||
} | ||
@@ -185,0 +190,0 @@ } |
@@ -150,14 +150,19 @@ /* eslint-disable no-unsanitized/property -- Source must be trusted as | ||
const ul = document.createElement('ul'); | ||
let bookUl; | ||
const bookUl = book ? null : document.createElement('ul'); | ||
const visited = {}; | ||
results.forEach((result) => { | ||
if (!book) { | ||
bookUl = document.createElement('ul'); | ||
let bookUlInner; | ||
if (!book && !visited[result.$book]) { | ||
const bookLi = document.createElement('li'); | ||
const bold = document.createElement('b'); | ||
bookUlInner = document.createElement('ul'); | ||
bold.textContent = `[${result.$book}]`; | ||
bookLi.append(bold); | ||
bookLi.append(ul); | ||
bookLi.append(bookUlInner); | ||
bookUl.append(bookLi); | ||
resultsHolder.append(bookUl); | ||
visited[result.$book] = true; | ||
} | ||
traverse(result, ul, (obj, parent) => { | ||
traverse(result, bookUlInner || ul, (obj, parent) => { | ||
const li = document.createElement('li'); | ||
@@ -183,3 +188,3 @@ li.innerHTML = obj.$text; | ||
resultsHolder.append(bookUl || ul); | ||
if (!bookUl) resultsHolder.append(ul); | ||
} | ||
@@ -186,0 +191,0 @@ } |
{ | ||
"name": "bahai-indexes", | ||
"type": "module", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"description": "Indexes to the Bahá'í Writings in JSON form", | ||
@@ -6,0 +6,0 @@ "main": "src/buildFlattenedJSONAndJS.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2636106
101155