more bulk editor work

This commit is contained in:
Dan Elbert 2016-01-30 21:35:39 -06:00
parent 3ca786281d
commit edfd6f12d6
2 changed files with 7 additions and 5 deletions

View File

@ -173,7 +173,9 @@
initializeStepEditor(item);
})
.on("cocoon:after-remove", function(e, item) {
if (item.find(".remove-button.existing").length) {
item.detach().appendTo("#deleted_steps");
}
reorder($(this));
})
.on('changed', 'input.sort_order', function() {
@ -191,7 +193,9 @@
initializeIngredientEditor(item, ingredientSearchEngine);
})
.on("cocoon:after-remove", function(e, item) {
if (item.find(".remove-button.existing").length) {
item.detach().appendTo("#deleted_ingredients");
}
reorder($ingredientList);
})
.on("typeahead:change", function(evt, value) {

View File

@ -15,7 +15,7 @@
<tr>
<th>Name</th>
<% if current_user? %>
<th colspan="2"></th>
<th></th>
<% end %>
<th>Yields</th>
<th>Time</th>
@ -34,8 +34,6 @@
<%= link_to edit_recipe_path(recipe), class: 'btn btn-sm btn-primary' do %>
<span class="glyphicon glyphicon-pencil"></span>
<% end %>
</td>
<td>
<%= link_to recipe, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' do %>
<span class="glyphicon glyphicon-remove"></span>
<% end %>