Hide issue custom fields when disabling issue tracking on new project.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12200 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-10-05 10:45:43 +00:00
parent 7b1b605ae8
commit 3f566d6042
2 changed files with 12 additions and 15 deletions

View File

@ -37,7 +37,6 @@
</label> </label>
<% end %> <% end %>
<%= hidden_field_tag 'project[enabled_module_names][]', '' %> <%= hidden_field_tag 'project[enabled_module_names][]', '' %>
<%= javascript_tag 'observeProjectModules()' %>
</fieldset> </fieldset>
<% end %> <% end %>
@ -87,3 +86,15 @@
}); });
<% end %> <% end %>
<% end %> <% end %>
<%= javascript_tag do %>
$(document).ready(function() {
$('#project_enabled_module_names_issue_tracking').on('change', function(){
if ($(this).attr('checked')){
$('#project_trackers, #project_issue_custom_fields').show();
} else {
$('#project_trackers, #project_issue_custom_fields').hide();
}
}).trigger('change');
});
<% end %>

View File

@ -517,20 +517,6 @@ function observeSearchfield(fieldId, targetId, url) {
}); });
} }
function observeProjectModules() {
var f = function() {
/* Hides trackers and issues custom fields on the new project form when issue_tracking module is disabled */
if ($('#project_enabled_module_names_issue_tracking').attr('checked')) {
$('#project_trackers').show();
} else {
$('#project_trackers').hide();
}
};
$(window).load(f);
$('#project_enabled_module_names_issue_tracking').change(f);
}
function initMyPageSortable(list, url) { function initMyPageSortable(list, url) {
$('#list-'+list).sortable({ $('#list-'+list).sortable({
connectWith: '.block-receiver', connectWith: '.block-receiver',