Skip to content

Commit 5fde234

Browse files
committed
Fix attribute set
1 parent ada803c commit 5fde234

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

script.js

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,23 @@ function createTableFromJSON(arr) {
1313
var tr = table.insertRow(-1);
1414

1515
var tabK = tr.insertCell(0);
16-
Object.assign(tabK, {
17-
textContent: arr[i].key,
18-
style: "padding-right: 2rem;",
19-
id: "gl-ext-key-" + i,
20-
"data-clipboard-target": "#gl-ext-key-" + i,
21-
title: "Copy name",
22-
"aria-live": "polite",
23-
"data-placement": "bottom",
24-
"data-toggle": "tooltip"
25-
});
16+
tabK.textContent = arr[i].key;
17+
tabK.style = "padding-right: 2rem;";
18+
tabK.title = "Copy name";
19+
tabK.id = "gl-ext-key-" + i;
20+
tabK.setAttribute("data-clipboard-target", "#gl-ext-key-" + i);
21+
tabK.setAttribute("aria-live", "polite");
22+
tabK.setAttribute("data-placement", "bottom");
23+
tabK.setAttribute("data-toggle", "tooltip");
2624

2725
var tabV = tr.insertCell(1);
28-
Object.assign(tabV, {
29-
textContent: arr[i].value,
30-
id: "gl-ext-val-" + i,
31-
"data-clipboard-target": "#gl-ext-val-" + i,
32-
title: "Copy value",
33-
"aria-live": "polite",
34-
"data-placement": "bottom",
35-
"data-toggle": "tooltip"
36-
});
26+
tabV.textContent = arr[i].value;
27+
tabV.title = "Copy value";
28+
tabV.id = "gl-ext-val-" + i;
29+
tabV.setAttribute("data-clipboard-target", "#gl-ext-val-" + i);
30+
tabV.setAttribute("aria-live", "polite");
31+
tabV.setAttribute("data-placement", "bottom");
32+
tabV.setAttribute("data-toggle", "tooltip");
3733
}
3834

3935
divForTheTable.appendChild(table);

0 commit comments

Comments
 (0)