Skip to content
Snippets Groups Projects
Verified Commit 448e989f authored by Shane Kilkelly's avatar Shane Kilkelly Committed by David Mehren
Browse files

If selecting 'output.pdf', set the filename to project-name.pdf

parent 70da55d4
No related branches found
No related tags found
No related merge requests found
...@@ -253,6 +253,10 @@ define [ ...@@ -253,6 +253,10 @@ define [
# auto-set filename based on selected file # auto-set filename based on selected file
$scope.$watch 'data.selectedProjectOutputFile', (newVal, oldVal) -> $scope.$watch 'data.selectedProjectOutputFile', (newVal, oldVal) ->
return if !newVal return if !newVal
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] fileName = newVal.split('/').reverse()[0]
if fileName if fileName
$scope.data.name = fileName $scope.data.name = fileName
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment