A more rational way to decode the html entities in editable

a more rational way to handle edit fields

revert to previous

add html_safe
This commit is contained in:
Ryan Truran 2017-12-25 11:29:26 -06:00
parent 29421661fb
commit db7603f799
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 %>