Skip to content

Commit

Permalink
Fix tooltip positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jorg-vr committed Dec 5, 2023
1 parent 2accdd0 commit 93096ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 7 additions & 0 deletions app/assets/javascripts/components/series_icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { customElement, property } from "lit/decorators.js";
* @attr {string} progress-class - a css class to apply that is related to the progress
* @attr {string} progress-icon - the icon to show that indicates the progress, defaults to mdi-school
* @attr {number} size - the size of the icon in pixels
* @attr {string} status - the status of the series, displayed as a tooltip
*/
@customElement("d-series-icon")
export class SeriesIcon extends ShadowlessLitElement {
Expand All @@ -33,11 +34,17 @@ export class SeriesIcon extends ShadowlessLitElement {
progress_icon = "mdi-school";
@property({ type: Number })
size = 40;
@property({ type: String })
status = "";

protected render(): TemplateResult {
return html`
<svg viewBox="0 0 40 40"
style="width: ${this.size}px; height: ${this.size}px; "
class="series-icon ${this.overlay_class} ${this.progress_class} ${this.deadline_class}"
title="${this.status}"
data-bs-toggle="tooltip"
data-bs-placement="top"
>
<defs>
<linearGradient id="rainbow" gradientTransform="rotate(135, 0.5, 0.5)" >
Expand Down
4 changes: 1 addition & 3 deletions app/views/series/_series_status.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
progress-icon="<%= progress_icon %>"
deadline-class="<%= deadline_class %>"
deadline-icon="<%= deadline_icon %>"
title="<%= series_status(series, user) %>"
data-bs-toggle="tooltip"
data-bs-placement="top"
status="<%= series_status(series, user) %>"
></d-series-icon>
<% else %>
<d-series-icon size="<%= size %>"></d-series-icon>
Expand Down

0 comments on commit 93096ba

Please sign in to comment.