mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 23:30:12 +01:00
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:
parent
29421661fb
commit
db7603f799
2 changed files with 10 additions and 2 deletions
|
|
@ -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']
|
||||
|
|
|
|||
|
|
@ -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)%>");
|
||||
TracksForm.set_project_name_and_default_project_name("<%= escape_javascript(@project.name).html_safe%>");
|
||||
<% end %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue