mirror of
https://github.com/zotero/zotero.git
synced 2026-10-04 02:31:47 +00:00
Ensure custom column renderCell returns element
This commit is contained in:
parent
0db1bae009
commit
51f2c76d82
1 changed files with 6 additions and 1 deletions
|
|
@ -2929,12 +2929,17 @@ var ItemTree = class ItemTree extends LibraryTree {
|
|||
try {
|
||||
// Pass document to renderCell so that it can create elements
|
||||
cell = column.renderCell.apply(this, [...arguments, document]);
|
||||
// Ensure that renderCell returns an Element
|
||||
if (!(cell instanceof Element)) {
|
||||
throw new Error('renderCell must return an Element');
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.logError(e);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
if (!cell) {
|
||||
cell = renderCell.apply(this, arguments);
|
||||
if (column.dataKey === 'numNotes' && data) {
|
||||
cell.dataset.l10nId = 'items-table-cell-notes';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue