mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 07:10:12 +01:00
Don't allow the project name to be edited in two places at once
When showing the project edit form, we disable the ability to edit the project name in place. When the project edit form is saved or cancelled, then we reenable the editing of the project name in place. Fixes #1205
This commit is contained in:
parent
a2df36cf71
commit
64cf5336c1
2 changed files with 3 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ function remove_edit_form() {
|
|||
function show_edit_form() {
|
||||
$('div#<%=dom_id(@project, 'edit')%>').html(html_for_edit_form());
|
||||
$('div#<%=dom_id(@project, 'edit')%>').fadeIn(500);
|
||||
$('div#project_name').editable('disable');
|
||||
}
|
||||
|
||||
function set_focus() {
|
||||
|
|
|
|||
|
|
@ -776,12 +776,14 @@ var ProjectListPage = {
|
|||
|
||||
/* submit project form after edit */
|
||||
$("form.edit-project-form button.positive").live('click', function (ev) {
|
||||
$('div#project_name').editable('enable');
|
||||
submit_with_ajax_and_block_element('form.edit-project-form', $(this));
|
||||
return false;
|
||||
});
|
||||
|
||||
/* cancel edit project form */
|
||||
$('form.edit-project-form a.negative').live('click', function(){
|
||||
$('div#project_name').editable('enable');
|
||||
$(this).parents('.edit-form').fadeOut(200, function () {
|
||||
$(this).parents('.list').find('.project').fadeIn(500);
|
||||
$(this).parents('.container').find('.item-show').fadeIn(500);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue