mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
trim project and entiry names/renames
This commit is contained in:
parent
f3ad7e10cd
commit
b7b307e82b
3 changed files with 7 additions and 3 deletions
|
@ -159,6 +159,7 @@ define [
|
|||
|
||||
|
||||
renameEntity: (entity, name) ->
|
||||
name = name?.trim()
|
||||
@ide.socket.emit 'renameEntity', entity.id, entity.get("type"), name
|
||||
entity.set("name", name)
|
||||
|
||||
|
@ -197,7 +198,7 @@ define [
|
|||
el = $($("#newEntityModalTemplate").html())
|
||||
input = el.find("input")
|
||||
create = _.once () =>
|
||||
name = input.val()
|
||||
name = input.val()?.trim()
|
||||
if name != ""
|
||||
callback(name)
|
||||
modal = new Modal
|
||||
|
|
|
@ -144,7 +144,7 @@ require [
|
|||
$confirm.click (e) =>
|
||||
$confirm.attr("disabled", true)
|
||||
$confirm.text("Creating...")
|
||||
projectName = $modal.find('input').val()
|
||||
projectName = $modal.find('input').val()?.trim()
|
||||
$.ajax
|
||||
url: '/project/new'
|
||||
type:'POST'
|
||||
|
|
|
@ -126,7 +126,10 @@ define [
|
|||
# http://stackoverflow.com/questions/6692031/check-if-event-is-triggered-by-a-human
|
||||
if e.originalEvent?
|
||||
if @ide.isAllowedToDoIt "readAndWrite"
|
||||
@project.set("name", e.target.value)
|
||||
newName = e.target.value?.trim()
|
||||
$("input.projectName").val(newName)
|
||||
@project.set("name", newName)
|
||||
|
||||
|
||||
bindToCompiler: ->
|
||||
$('select#compilers').val(@project.get("compiler"))
|
||||
|
|
Loading…
Reference in a new issue