Skip to content

Commit

Permalink
Fix FileDownload with icon (#6981)
Browse files Browse the repository at this point in the history
* fix filedownload with icon

* remove ;
  • Loading branch information
MarcSkovMadsen authored and philippjfr committed Jul 16, 2024
1 parent 710f5db commit 638d8c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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

0 comments on commit 638d8c9

Please sign in to comment.