Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FileDownload with icon #6981

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions panel/dist/css/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,3 @@
justify-content: center;
padding: 0px;
}

:host(.bk-panel-models-widgets-FileDownload) .bk-btn .bk-TablerIcon {
margin-left: 0.5em;
}
8 changes: 5 additions & 3 deletions panel/models/file_download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {Icon} from "@bokehjs/models/ui/icons/icon"

import buttons_css, * as buttons from "@bokehjs/styles/buttons.css"
import type {StyleSheetLike} from "@bokehjs/core/dom"
import {prepend, nbsp, text, button, input} from "@bokehjs/core/dom"
import {nbsp, text, button, input} from "@bokehjs/core/dom"

function dataURItoBlob(dataURI: string) {
// convert base64 to raw binary data held in a string
Expand Down Expand Up @@ -97,7 +97,8 @@ export class FileDownloadView extends InputWidgetView {
})
if (this.icon_view != null) {
const separator = this.model.label != "" ? nbsp() : text("")
prepend(this.button_el, this.icon_view.el, separator)
this.anchor_el.appendChild(this.icon_view.el)
this.anchor_el.appendChild(separator)
this.icon_view.render()
}
this._update_button_style()
Expand Down Expand Up @@ -200,7 +201,8 @@ export class FileDownloadView extends InputWidgetView {
}

_update_label(): void {
this.anchor_el.textContent = this.model.label
const label = document.createTextNode(this.model.label)
this.anchor_el.appendChild(label)
}

_update_button_style(): void {
Expand Down
Loading