mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
nice tooltips for side buttons
This commit is contained in:
parent
1302765478
commit
7528181ca2
@ -2,6 +2,8 @@ import BasicWidget from "./basic_widget.js";
|
|||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<span class="button-widget"
|
<span class="button-widget"
|
||||||
|
data-toggle="tooltip"
|
||||||
|
data-placement="right"
|
||||||
title="">
|
title="">
|
||||||
<span class="bx"></span>
|
<span class="bx"></span>
|
||||||
</span>
|
</span>
|
||||||
@ -20,6 +22,11 @@ export default class ButtonWidget extends BasicWidget {
|
|||||||
|
|
||||||
this.$widget.on("click", () => this.triggerCommand(this.settings.command));
|
this.$widget.on("click", () => this.triggerCommand(this.settings.command));
|
||||||
|
|
||||||
|
this.$widget.tooltip({
|
||||||
|
html: true,
|
||||||
|
title: () => this.settings.title
|
||||||
|
});
|
||||||
|
|
||||||
super.doRender();
|
super.doRender();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,28 +42,34 @@ const TPL = `
|
|||||||
<div class="sync-status">
|
<div class="sync-status">
|
||||||
<span class="sync-status-icon sync-status-unknown bx bx-time"
|
<span class="sync-status-icon sync-status-unknown bx bx-time"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
|
data-placement="right"
|
||||||
title="<p>Sync status will be known once the next sync attempt starts.</p><p>Click to trigger sync now.</p>">
|
title="<p>Sync status will be known once the next sync attempt starts.</p><p>Click to trigger sync now.</p>">
|
||||||
</span>
|
</span>
|
||||||
<span class="sync-status-icon sync-status-connected-with-changes bx-wifi"
|
<span class="sync-status-icon sync-status-connected-with-changes bx-wifi"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
|
data-placement="right"
|
||||||
title="<p>Connected to the sync server. <br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>">
|
title="<p>Connected to the sync server. <br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>">
|
||||||
<span class="bx bxs-star sync-status-sub-icon"></span>
|
<span class="bx bxs-star sync-status-sub-icon"></span>
|
||||||
</span>
|
</span>
|
||||||
<span class="sync-status-icon sync-status-connected-no-changes bx bx-wifi"
|
<span class="sync-status-icon sync-status-connected-no-changes bx bx-wifi"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
|
data-placement="right"
|
||||||
title="<p>Connected to the sync server.<br>All changes have been already synced.</p><p>Click to trigger sync.</p>">
|
title="<p>Connected to the sync server.<br>All changes have been already synced.</p><p>Click to trigger sync.</p>">
|
||||||
</span>
|
</span>
|
||||||
<span class="sync-status-icon sync-status-disconnected-with-changes bx bx-wifi-off"
|
<span class="sync-status-icon sync-status-disconnected-with-changes bx bx-wifi-off"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
|
data-placement="right"
|
||||||
title="<p>Establishing the connection to the sync server was unsuccessful.<br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>">
|
title="<p>Establishing the connection to the sync server was unsuccessful.<br>There are some outstanding changes yet to be synced.</p><p>Click to trigger sync.</p>">
|
||||||
<span class="bx bxs-star sync-status-sub-icon"></span>
|
<span class="bx bxs-star sync-status-sub-icon"></span>
|
||||||
</span>
|
</span>
|
||||||
<span class="sync-status-icon sync-status-disconnected-no-changes bx bx-wifi-off"
|
<span class="sync-status-icon sync-status-disconnected-no-changes bx bx-wifi-off"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
|
data-placement="right"
|
||||||
title="<p>Establishing the connection to the sync server was unsuccessful.<br>All known changes have been synced.</p><p>Click to trigger sync.</p>">
|
title="<p>Establishing the connection to the sync server was unsuccessful.<br>All known changes have been synced.</p><p>Click to trigger sync.</p>">
|
||||||
</span>
|
</span>
|
||||||
<span class="sync-status-icon sync-status-in-progress bx bx-analyse bx-spin"
|
<span class="sync-status-icon sync-status-in-progress bx bx-analyse bx-spin"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
|
data-placement="right"
|
||||||
title="Sync with the server is in progress.">
|
title="Sync with the server is in progress.">
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -848,7 +848,7 @@ body {
|
|||||||
background-color: inherit;
|
background-color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
[data-toggle="tooltip"] span {
|
[data-toggle="tooltip"]:not(.button-widget) span {
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
border-bottom: 1px dotted;
|
border-bottom: 1px dotted;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user