fix locking of used blocks in select menu

pull/6827/head
Florian Kraft 10 years ago
parent 801c9f629e
commit 8e6bde04c3
No known key found for this signature in database
GPG Key ID: 786CD08D94605A9E
  1. 4
      app/assets/javascripts/my_project_page/my_project_page.js
  2. 2
      app/views/my_projects_overviews/index.html.erb

@ -79,7 +79,9 @@
return; return;
} }
for (var i = 0; i < s.options.length; i++) { for (var i = 0; i < s.options.length; i++) {
if ($('block_' + s.options[i].value)) { var name = s.options[i].value || '';
name = name.replace(/\-/g, '_');
if ($('block_' + name)) {
s.options[i].disabled = true; s.options[i].disabled = true;
} else { } else {
s.options[i].disabled = false; s.options[i].disabled = false;

@ -30,7 +30,7 @@ See doc/COPYRIGHT.md for more details.
<%= toolbar title: l(:label_overview) do %> <%= toolbar title: l(:label_overview) do %>
<% if User.current.allowed_to?(:add_subprojects, project) %> <% if User.current.allowed_to?(:add_subprojects, project) %>
<li class="toolbar-item"> <li class="toolbar-item">
<%= link_to new_project_path(parent_id: project), class: 'button -highlight' do %> <%= link_to new_project_path(parent_id: project), class: 'button -alt-highlight' do %>
<i class="icon-add"></i> <%= l(:label_subproject_new) %> <i class="icon-add"></i> <%= l(:label_subproject_new) %>
<% end %> <% end %>
</li> </li>

Loading…
Cancel
Save