Auto-set filename based on selected file

This commit is contained in:
Shane Kilkelly 2018-05-16 11:12:00 +01:00
parent 74d8e67a05
commit e3bc6cac9e

View file

@ -232,6 +232,13 @@ define [
$scope.data.selectedProjectEntity = null $scope.data.selectedProjectEntity = null
$scope.getProjectEntities($scope.data.selectedProject) $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) -> $scope._resetAfterResponse = (opts) ->
isError = opts.err == true isError = opts.err == true
$scope.state.inFlight = false $scope.state.inFlight = false