1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 18:30:53 +00:00

Update wiki page (#6298)

* add wiki page

* delete wiki page

* update

* move wiki page

* optimize code

* update

* fix code format

change error message

---------

Co-authored-by: 孙永强 <11704063+s-yongqiang@user.noreply.gitee.com>
Co-authored-by: Michael An <2331806369@qq.com>
This commit is contained in:
awu0403
2024-07-15 13:46:05 +08:00
committed by GitHub
parent 6d4e06b571
commit f12358edd1
9 changed files with 244 additions and 53 deletions

View File

@@ -103,11 +103,16 @@ export default class PageUtils {
}
function _insertPageRecursion(item, page_id, target_page_id, target_id, move_position) {
if (item.id === target_id) {
let insertIndex = target_page_id ? item.children.findIndex(item => item.id === target_page_id) : -1;
if (move_position === 'move_below') {
insertIndex++;
if (item.children) {
let insertIndex = target_page_id ? item.children.findIndex(item => item.id === target_page_id) : -1;
if (move_position === 'move_below') {
insertIndex++;
}
item.children.splice(insertIndex, 0, movedPage);
} else {
item.children = [];
item.children.push(movedPage);
}
item.children.splice(insertIndex, 0, movedPage);
return;
}
item.children && item.children.forEach(item => {