mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Auto-set filename based on selected file
This commit is contained in:
parent
74d8e67a05
commit
e3bc6cac9e
1 changed files with 7 additions and 0 deletions
|
@ -232,6 +232,13 @@ define [
|
|||
$scope.data.selectedProjectEntity = null
|
||||
$scope.getProjectEntities($scope.data.selectedProject)
|
||||
|
||||
# auto-set filename based on selected file
|
||||
$scope.$watch 'data.selectedProjectEntity', (newVal, oldVal) ->
|
||||
return if !newVal
|
||||
fileName = newVal.split('/').reverse()[0]
|
||||
if fileName
|
||||
$scope.data.name = fileName
|
||||
|
||||
$scope._resetAfterResponse = (opts) ->
|
||||
isError = opts.err == true
|
||||
$scope.state.inFlight = false
|
||||
|
|
Loading…
Reference in a new issue