mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Enable switching between source and output files
This commit is contained in:
parent
64ec90f34f
commit
6672a20c2b
2 changed files with 20 additions and 0 deletions
|
@ -126,6 +126,13 @@ script(type='text/ng-template', id='newFileModalTemplate')
|
|||
ng-repeat="outputFile in data.projectOutputFiles"
|
||||
value="{{ outputFile.path }}"
|
||||
) {{ outputFile.path }}
|
||||
div
|
||||
a(
|
||||
href="#"
|
||||
ng-click="toggleOutputFilesMode()"
|
||||
)
|
||||
span(ng-show="state.isOutputFilesMode") Switch to source files
|
||||
span(ng-show="!state.isOutputFilesMode") Switch to output files
|
||||
|
||||
.form-controls.row-spaced-small
|
||||
label(for="name") File Name In This Project
|
||||
|
|
|
@ -229,11 +229,20 @@ define [
|
|||
$scope.$watch 'data.selectedProjectId', (newVal, oldVal) ->
|
||||
return if !newVal
|
||||
$scope.data.selectedProjectEntity = null
|
||||
$scope.data.selectedProjectOutputFile = null
|
||||
if $scope.state.isOutputFilesMode
|
||||
$scope.compileProjectAndGetOutputFiles($scope.data.selectedProjectId)
|
||||
else
|
||||
$scope.getProjectEntities($scope.data.selectedProjectId)
|
||||
|
||||
$scope.$watch 'state.isOutputFilesMode', (newVal, oldVal) ->
|
||||
return if !newVal and !oldVal
|
||||
$scope.data.selectedProjectOutputFile = null
|
||||
if newVal == true
|
||||
$scope.compileProjectAndGetOutputFiles($scope.data.selectedProjectId)
|
||||
else
|
||||
$scope.getProjectEntities($scope.data.selectedProjectId)
|
||||
|
||||
# auto-set filename based on selected file
|
||||
$scope.$watch 'data.selectedProjectEntity', (newVal, oldVal) ->
|
||||
return if !newVal
|
||||
|
@ -258,6 +267,10 @@ define [
|
|||
$scope.state.inflight = false
|
||||
$scope.state.error = isError
|
||||
|
||||
$scope.toggleOutputFilesMode = () ->
|
||||
return if !$scope.data.selectedProjectId
|
||||
$scope.state.isOutputFilesMode = !$scope.state.isOutputFilesMode
|
||||
|
||||
$scope.shouldEnableProjectSelect = () ->
|
||||
{ state, data } = $scope
|
||||
return !state.inFlight.projects && data.projects
|
||||
|
|
Loading…
Reference in a new issue