feat: add addon version to about:addons list view and improve AddonOptions update method to handle missing updateInstall
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user