From 9275dbb732136ff562ba90cc811037480e0bba30 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 23 Mar 2022 11:20:32 -0700 Subject: [PATCH] Display the note SVG in a container div --- .../web/lib/highlights/highlightGenerator.ts | 18 +++++++++--------- .../web/lib/highlights/highlightHelpers.ts | 1 - 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/web/lib/highlights/highlightGenerator.ts b/packages/web/lib/highlights/highlightGenerator.ts index cdc7b5406..365f12367 100644 --- a/packages/web/lib/highlights/highlightGenerator.ts +++ b/packages/web/lib/highlights/highlightGenerator.ts @@ -152,17 +152,17 @@ export function makeHighlightNodeAttributes( if (withNote && lastElement) { lastElement.classList.add('last_element') - const button = document.createElement('img') - button.className = 'highlight_note_button' - button.src = '/static/icons/highlight-note-icon.svg' - button.alt = 'Add note' - button.setAttribute(highlightNoteIdAttribute, id) + const svg = noteImage() + svg.setAttribute(highlightNoteIdAttribute, id) - lastElement.appendChild(button) + const ctr = document.createElement('div') + ctr.className = 'highlight_note_button' + ctr.appendChild(svg) + ctr.setAttribute(highlightNoteIdAttribute, id) + ctr.setAttribute('width', '14px') + ctr.setAttribute('height', '14px') - // const svg = noteImage() - // svg.setAttribute(highlightNoteIdAttribute, id) - // lastElement.appendChild(svg) + lastElement.appendChild(ctr) } return { diff --git a/packages/web/lib/highlights/highlightHelpers.ts b/packages/web/lib/highlights/highlightHelpers.ts index 466e26d4c..e01d02dd3 100644 --- a/packages/web/lib/highlights/highlightHelpers.ts +++ b/packages/web/lib/highlights/highlightHelpers.ts @@ -32,7 +32,6 @@ export function noteImage(): SVGSVGElement { svg.setAttribute('width', '14') svg.setAttribute('height', '14') svg.setAttribute('fill', 'none') - svg.setAttribute('class', 'highlight_note_button') const path = document.createElementNS(svgURI, 'path') path.setAttribute(