mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-04 08:45:29 +00:00
If selecting 'output.pdf', set the filename to project-name.pdf
This commit is contained in:
parent
67dcbff450
commit
54cdbd738c
1 changed files with 7 additions and 3 deletions
|
@ -253,9 +253,13 @@ define [
|
|||
# auto-set filename based on selected file
|
||||
$scope.$watch 'data.selectedProjectOutputFile', (newVal, oldVal) ->
|
||||
return if !newVal
|
||||
fileName = newVal.split('/').reverse()[0]
|
||||
if fileName
|
||||
$scope.data.name = fileName
|
||||
if newVal == 'output.pdf'
|
||||
project = _.find($scope.data.projects, (p) -> p._id == $scope.data.selectedProjectId)
|
||||
$scope.data.name = if project?.name? then "#{project.name}.pdf" else 'output.pdf'
|
||||
else
|
||||
fileName = newVal.split('/').reverse()[0]
|
||||
if fileName
|
||||
$scope.data.name = fileName
|
||||
|
||||
_setInFlight = (type) ->
|
||||
$scope.state.inFlight[type] = true
|
||||
|
|
Loading…
Reference in a new issue