feat: add addon version to about:addons list view and improve AddonOptions update method to handle missing updateInstall

This commit is contained in:
Alex Kontos
2022-07-14 15:19:23 +01:00
parent 58f52a838b
commit 9ffa9c32f5
2 changed files with 11 additions and 1 deletions

View File

@@ -401,6 +401,10 @@
<img class="card-heading-icon addon-icon" alt="" />
<div class="card-contents">
<div class="addon-name-container">
<!-- WATERFOX -->
<div class="addon-name">
<div class="addon-version-number"></div>
</div>
<a
class="addon-badge addon-badge-recommended"
is="moz-support-link"

View File

@@ -1591,8 +1591,10 @@ class AddonOptions extends HTMLElement {
}
update(card, addon, updateInstall) {
// Be robust if callers don't pass updateInstall: derive it from the addon.
const effectiveUpdateInstall = updateInstall || getUpdateInstall(addon);
for (let el of this.items) {
this.setElementState(el, card, addon, updateInstall);
this.setElementState(el, card, addon, effectiveUpdateInstall);
}
// Update the separators visibility based on the updated visibility
@@ -3016,6 +3018,10 @@ class AddonCard extends HTMLElement {
}
nameContainer.prepend(nameHeading);
// WATERFOX
let collapsedVersion = this.card.querySelector(".addon-version-number");
collapsedVersion.textContent = addon.version;
let panelType = addon.type == "plugin" ? "plugin-options" : "addon-options";
this.options = document.createElement(panelType);
this.options.render();