mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #2604 from overleaf/cmg-duplicate-modal-root
Stop duplicate file modal appearing when moving back to original folder - root edition GitOrigin-RevId: 11fe3b2457190f8bada010a344143a66b8967f34
This commit is contained in:
parent
b812109cb7
commit
bb3394885c
1 changed files with 16 additions and 11 deletions
|
@ -22,19 +22,24 @@ define(['base'], App =>
|
||||||
} else {
|
} else {
|
||||||
entities = [$(ui.draggable).scope().entity]
|
entities = [$(ui.draggable).scope().entity]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ids = rootFolder.children.map(entity => entity.id)
|
||||||
|
|
||||||
for (let dropped_entity of Array.from(entities)) {
|
for (let dropped_entity of Array.from(entities)) {
|
||||||
try {
|
if (!ids.includes(dropped_entity.id)) {
|
||||||
ide.fileTreeManager.moveEntity(dropped_entity, rootFolder)
|
try {
|
||||||
} catch (err) {
|
ide.fileTreeManager.moveEntity(dropped_entity, rootFolder)
|
||||||
$modal.open({
|
} catch (err) {
|
||||||
templateUrl: 'duplicateFileModalTemplate',
|
$modal.open({
|
||||||
controller: 'DuplicateFileModalController',
|
templateUrl: 'duplicateFileModalTemplate',
|
||||||
resolve: {
|
controller: 'DuplicateFileModalController',
|
||||||
fileName() {
|
resolve: {
|
||||||
return dropped_entity.name
|
fileName() {
|
||||||
|
return dropped_entity.name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$scope.$digest()
|
$scope.$digest()
|
||||||
|
|
Loading…
Reference in a new issue