mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-24 01:29:35 +02:00
Merge pull request #2566 from overleaf/cmg-invalid-filename
Suppress error for empty filename when still editing GitOrigin-RevId: 42d7fa9af9b183603577effb5d1daaafa21ce065
This commit is contained in:
committed by
Copybot
parent
80e9afe42c
commit
3785be1fec
@@ -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}}"})}
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user