Skip to content

Commit

Permalink
fix: show correct cell value in popup
Browse files Browse the repository at this point in the history
  • Loading branch information
lucien martijn committed Jan 23, 2025
1 parent 6fdd559 commit 2656edd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions media/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,22 @@

function onPopupOpenedQueryResultTab(component) {
const parentContainerId = 'table-queryTab'
onPopupOpened(parentContainerId)
onPopupOpened(parentContainerId, component)
}

function onPopupOpenedDataTab(component) {
const parentContainerId = 'data-tab-panel'
onPopupOpened(parentContainerId)
onPopupOpened(parentContainerId, component)
}

function onPopupOpenedSchemaTab(component) {
const parentContainerId = 'schema'
onPopupOpened(parentContainerId)
onPopupOpened(parentContainerId, component)
}

function onPopupOpenedMetaDataTab(component) {
const parentContainerId = 'metadata'
onPopupOpened(parentContainerId)
onPopupOpened(parentContainerId, component)
}

function containsHTML(str) {
Expand All @@ -192,10 +192,13 @@
.replace(/'/g, ''')
}

function onPopupOpened(parentContainerId) {
const element = document.getElementsByClassName(
function onPopupOpened(parentContainerId, component) {
let element = document.getElementsByClassName(
'tabulator-popup tabulator-popup-container'
)[0]

const cellValue = component.getValue()

let innerHTML = element.innerHTML
let style = element.style

Expand All @@ -220,6 +223,7 @@
tab: tab,
})
} else {
innerHTML = cellValue
if (containsHTML(innerHTML)) {
element.innerHTML = escapeHtml(innerHTML)
}
Expand Down

0 comments on commit 2656edd

Please sign in to comment.