removed prototype usage of observeProjectModules()

pull/1233/head
Philipp Tessenow 11 years ago
parent b900fcf24b
commit e85be3ee36
  1. 20
      app/assets/javascripts/application.js.erb
  2. 4
      app/views/projects/form/_modules.html.erb

@ -485,21 +485,19 @@ function observeRelatedIssueField(url) {
});
}
function setVisible(id, visible) {
var el = $(id);
if (el) {if (visible) {el.show();} else {el.hide();}}
}
// Hides types and issues custom fields on the new project form when
// work_package_tracking module is disabled.
function observeProjectModules() {
var f = function() {
/* Hides types and issues custom fields on the new project form when work_package_tracking module is disabled */
var c = ($('project_enabled_module_names_work_package_tracking').checked == true);
setVisible('project_types', c);
setVisible('project_issue_custom_fields', c);
if (jQuery('#project_enabled_module_names_work_package_tracking').attr('checked')) {
jQuery('#project_types, #project_issue_custom_fields').show();
} else {
jQuery('#project_types, #project_issue_custom_fields').hide();
}
};
Event.observe(window, 'load', f);
Event.observe('project_enabled_module_names_work_package_tracking', 'change', f);
jQuery(window).load(f);
jQuery('#project_enabled_module_names_work_package_tracking').change(f);
}
/*

@ -34,7 +34,7 @@ See doc/COPYRIGHT.rdoc for more details.
</div>
<% Redmine::AccessControl.available_project_modules.each do |m| %>
<label class="floating">
<%= check_box_tag 'project[enabled_module_names][]',
<%= check_box_tag 'project[enabled_module_names][]',
m,
project.module_enabled?(m),
:id => "project_enabled_module_names_#{m}" %>
@ -42,5 +42,5 @@ See doc/COPYRIGHT.rdoc for more details.
</label>
<% end %>
<%= hidden_field_tag 'project[enabled_module_names][]', '' %>
<%= javascript_tag 'observeProjectModules()' %>
<%= javascript_tag 'observeProjectModules();' %>
</fieldset>

Loading…
Cancel
Save