1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2025-04-14 17:13:32 +00:00

Merge pull request from overleaf/cmg-invalid-filename

Suppress error for empty filename when still editing

GitOrigin-RevId: 42d7fa9af9b183603577effb5d1daaafa21ce065
This commit is contained in:
Chrystal Maria Griffiths 2020-02-12 11:30:31 +00:00 committed by Copybot
parent 80e9afe42c
commit 3785be1fec
2 changed files with 1 additions and 7 deletions
services/web
app/views/project/editor
frontend/js/ide/file-tree/controllers

View file

@ -47,7 +47,7 @@ script(type='text/ng-template', id='newFileModalTemplate')
div(ng-switch="error")
span(ng-switch-when="already exists") #{translate("file_already_exists")}
span(ng-switch-default) {{error}}
div.alert.alert-danger.row-spaced-small(ng-show="newDocForm.name.$error.validFile")
div.alert.alert-danger.row-spaced-small(ng-show="newDocForm.name.$error.validFile && newDocForm.name.$viewValue.length")
| #{translate('files_cannot_include_invalid_characters')}
div(ng-if="type == 'upload'", ng-controller="UploadFileModalController")
.alert.alert-warning.small(ng-if="tooManyFiles") #{translate("maximum_files_uploaded_together", {max:"{{max_files}}"})}

View file

@ -192,12 +192,6 @@ define(['base'], function(App) {
App.controller('NewDocModalController', function($scope, ide, $timeout) {
$scope.inputs = { name: 'name.tex' }
const validate = function() {
const { name } = $scope.inputs
$scope.state.valid = name != null && name.length > 0
}
$scope.$watch('inputs.name', validate)
$timeout(() => $scope.$broadcast('open'), 200)
return $scope.$on('create', function() {