Scaffold: Fix copying JSON test data

Previously only copied '[object Object]'.
This commit is contained in:
Abe Jellinek 2022-11-01 16:04:24 -04:00
parent b9a5fd9f78
commit 42e042c6c6

View file

@ -1729,6 +1729,9 @@ var Scaffold = new function () {
var url = item.getElementsByTagName("listcell")[0].getAttribute("label");
var test = JSON.parse(item.getUserData("test-string"));
var urlOrData = (test.input !== undefined) ? test.input : url;
if (typeof urlOrData !== 'string') {
urlOrData = JSON.stringify(urlOrData, null, '\t');
}
Zotero.Utilities.Internal.copyTextToClipboard(urlOrData);
};