mirror of
https://github.com/zotero/zotero.git
synced 2026-09-07 08:26:14 +00:00
Merge e0b12a04a7 into fc17dcd24a
This commit is contained in:
commit
348aba1ca9
2 changed files with 22 additions and 3 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue