This commit is contained in:
Mi Ramon 2026-09-05 16:10:58 +02:00 committed by GitHub
commit 348aba1ca9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 3 deletions

View file

@ -1114,15 +1114,19 @@
insertCustomRow(rowElem, position = "end") {
switch (position) {
case "start": {
this._infoTable.prepend(rowElem);
let itemTypeRow = this._infoTable.querySelector(".meta-label[fieldname=itemType]")?.parentElement;
if (itemTypeRow) {
this._infoTable.insertBefore(rowElem, itemTypeRow);
}
else {
this._infoTable.append(rowElem);
}
break;
}
case "afterCreators": {
// The `_firstRowBeforeCreators` is actually the first row after creator rows
if (this._firstRowBeforeCreators) {
this._infoTable.insertBefore(rowElem, this._firstRowBeforeCreators);
// Update the anchor node for creator rows
this._firstRowBeforeCreators = rowElem;
}
else {
this._infoTable.append(rowElem);

View file

@ -437,6 +437,21 @@
}
this._refresh([rowID]);
}
get data() {
let options = this.options;
// Since `rowID` is mapped to a namespaced key including `pluginID`,
// sorting by it produces a stable visual order grouped by plugin,
if (Array.isArray(options) && options.length > 1) {
options = options.sort((a, b) =>
String(a.rowID ?? "").localeCompare(String(b.rowID ?? ""))
);
}
return {
updateID: this.updateID,
options,
};
}
}