Merge pull request #2096 from RyanTruran/origin

A more rational way to load the text input with the previous names
This commit is contained in:
Matt Rogers 2018-01-03 09:31:36 -06:00 committed by GitHub
commit a65ab48b9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View file

@ -527,6 +527,10 @@ var ProjectListPage = {
setup_behavior: function() {
/* in-place edit of project name */
$('span#project_name').editable(ProjectListPage.save_project_name, {
data:function(encoded, config){
var decoded = $('<p></p>').html(encoded).text();
return decoded;
},
style: 'padding: 0px; width=100%;',
submit: i18n['common.ok'],
cancel: i18n['common.cancel'],
@ -657,6 +661,10 @@ var ContextListPage = {
setup_behavior: function() {
/* in place edit of context name */
$('div.context span#context_name').editable(ContextListPage.save_context_name, {
data:function(encoded, config){
var decoded = $('<p></p>').html(encoded).text();
return decoded;
},
style: 'padding:0px',
submit: i18n['common.ok'],
cancel: i18n['common.cancel']

View file

@ -1,4 +1,4 @@
<% if @saved -%>
TracksPages.page_inform('<%=t('projects.status_project_name_changed')%>');
TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name)%>");
<% end %>
TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name).html_safe%>");
<% end %>