Merge pull request #44 from floriank/fix/ci-failing-cukes

Fix locking of used blocks in select menu
pull/6827/head
Jan Sandbrink 10 years ago
commit 0fb451b6c3
  1. 7
      app/assets/javascripts/my_project_page/my_project_page.js
  2. 2
      app/views/my_projects_overviews/index.html.erb

@ -79,7 +79,12 @@
return;
}
for (var i = 0; i < s.options.length; i++) {
if ($('block_' + s.options[i].value)) {
var name = s.options[i].value || '';
// this becomes necessary as the block names are saved with dashes in the db,
// but their ids use underscores in the frontend - this changes the name to find
// the block in the DOM
name = name.replace(/\-/g, '_');
if ($('block_' + name)) {
s.options[i].disabled = true;
} else {
s.options[i].disabled = false;

@ -30,7 +30,7 @@ See doc/COPYRIGHT.md for more details.
<%= toolbar title: l(:label_overview) do %>
<% if User.current.allowed_to?(:add_subprojects, project) %>
<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) %>
<% end %>
</li>

Loading…
Cancel
Save