fixup: section numbering when cutAt is -1
This commit is contained in:
parent
6801d8804e
commit
91d6959a17
|
@ -252,7 +252,7 @@ function MozSectionWidget(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// renumber
|
// renumber
|
||||||
for (let i = cutAt, {sections} = finder, sec; (sec = sections[i++]);) {
|
for (let i = Math.max(0, cutAt), {sections} = finder, sec; (sec = sections[i++]);) {
|
||||||
if (!toDelay.includes(sec)) {
|
if (!toDelay.includes(sec)) {
|
||||||
const data = $(C_LABEL, sec.widget.node).dataset;
|
const data = $(C_LABEL, sec.widget.node).dataset;
|
||||||
if (data.index !== `${i}`) data.index = `${i}`;
|
if (data.index !== `${i}`) data.index = `${i}`;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user