mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
Fix page outdent function in toc
This commit is contained in:
parent
899281044e
commit
2e9fafe966
1 changed files with 4 additions and 4 deletions
|
@ -94,24 +94,24 @@ function getState(toc, page) {
|
|||
|
||||
if (index3 !== -1) {
|
||||
for (var i3 = index3; i3 < toc.length; i3++) {
|
||||
if (toc[i3].level < page.level) {
|
||||
if (toc[i3].get('level') < page.get('level')) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (page.level === toc[i3].level) {
|
||||
if (page.get('level') === toc[i3].get('level')) {
|
||||
state.tocTools.downTarget = toc[i3].id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (page.level > downPage.level) {
|
||||
if (page.get('level') > downPage.get('level')) {
|
||||
state.tocTools.downTarget = '';
|
||||
}
|
||||
}
|
||||
|
||||
// can we outdent?
|
||||
state.tocTools.allowOutdent = page.level > 1;
|
||||
state.tocTools.allowOutdent = page.get('level') > 1;
|
||||
|
||||
state.upDisabled = state.tocTools.upTarget === '';
|
||||
state.downDisabled = state.tocTools.downTarget === '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue