2021-11-14 12:42:50 +00:00
|
|
|
import BasicWidget from "../basic_widget.js";
|
|
|
|
|
|
|
|
const TPL = `
|
2021-11-14 21:52:18 +01:00
|
|
|
<div style="display: none;">
|
2021-11-14 12:42:50 +00:00
|
|
|
<style>
|
|
|
|
.global-menu-button-update-available-button {
|
|
|
|
width: 21px !important;
|
|
|
|
height: 21px !important;
|
|
|
|
padding: 0 !important;
|
|
|
|
|
2022-09-18 13:52:19 +02:00
|
|
|
border-radius: var(--button-border-radius);
|
2021-11-14 12:42:50 +00:00
|
|
|
transform: scale(0.9);
|
|
|
|
border: none;
|
|
|
|
opacity: 0.8;
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
.global-menu-button-wrapper:hover .global-menu-button-update-available-button {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
</style>
|
2021-11-14 21:52:18 +01:00
|
|
|
|
|
|
|
<span class="bx bx-sync global-menu-button-update-available-button" title="Update available"></span>
|
|
|
|
</div>
|
|
|
|
`;
|
2021-11-14 12:42:50 +00:00
|
|
|
|
|
|
|
export default class UpdateAvailableWidget extends BasicWidget {
|
|
|
|
doRender() {
|
|
|
|
this.$widget = $(TPL);
|
|
|
|
}
|
|
|
|
|
2021-11-14 21:52:18 +01:00
|
|
|
updateVersionStatus(latestVersion) {
|
|
|
|
this.$widget.toggle(latestVersion > glob.triliumVersion);
|
2021-11-14 12:42:50 +00:00
|
|
|
}
|
|
|
|
}
|