Skip to content

Commit

Permalink
Fix #2412 (clicking note icon did not go to note display)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuomas2 committed Feb 4, 2023
1 parent 7fa8150 commit c3abaf8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/bibleview-js/src/composables/bookmarks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ export function useBookmarks(
}
// Add bookmark marker for marker style bookmarks & My Notes symbols & to the end of bookmark
if (config.showBookmarks || config.showMyNotes) {
const bookmarkList = [];
const bookmarkList: Bookmark[] = [];
let hasNote = false;

for (const b of bookmarks.filter(b => arrayEq(combinedRange(b)[1], [endOrdinal, endOff]))) {
Expand All @@ -614,8 +614,11 @@ export function useBookmarks(
const bookmarkLabel = getBookmarkStyleLabel(bookmark);
const color = adjustedColor(bookmarkLabel.color).string();
const iconElement = getIconElement(hasNote ? editIcon : bookmarkIcon, color);
iconElement.addEventListener("click", event => addEventFunction(event,
null, {bookmarkId: bookmark.id, priority: EventPriorities.BOOKMARK_MARKER}));
iconElement.addEventListener("click", event => {
for (const b of bookmarkList) {
addEventFunction(event, null, {bookmarkId: b.id, priority: EventPriorities.BOOKMARK_MARKER});
}
});
lastElement!.parentNode!.insertBefore(iconElement, lastElement!.nextSibling);
if (bookmarkList.length > 1) {
iconElement.appendChild(document.createTextNode(${bookmarkList.length}`));
Expand Down

0 comments on commit c3abaf8

Please sign in to comment.