mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-09 22:54:51 +03:00
fix: remove extra "slice()" call
This commit is contained in:
parent
9d7249e4bc
commit
26d3c7c274
|
@ -58,7 +58,7 @@ class Json extends React.PureComponent<JsonProps> {
|
||||||
collapseAll = () => {
|
collapseAll = () => {
|
||||||
const elements = this.node.getElementsByClassName('collapsible');
|
const elements = this.node.getElementsByClassName('collapsible');
|
||||||
// skip first item to avoid collapsing whole object/array
|
// skip first item to avoid collapsing whole object/array
|
||||||
const elementsArr = Array.prototype.slice.call(elements).slice(1);
|
const elementsArr = Array.prototype.slice.call(elements, 1);
|
||||||
|
|
||||||
for (const expanded of elementsArr) {
|
for (const expanded of elementsArr) {
|
||||||
(expanded.parentNode as Element)!.classList.add('collapsed');
|
(expanded.parentNode as Element)!.classList.add('collapsed');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user