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