* delete only one row during DeleteDeliverable(Hour|Cost)

* delete button is now a simple link and no input tag to prevent accidental submit

git-svn-id: https://dev.finn.de/svn/cockpit/trunk@132 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
hjust 15 years ago
parent 11380467da
commit af35c40c8f
  1. 2
      app/views/deliverables/_deliverable_cost.rhtml
  2. 2
      app/views/deliverables/_deliverable_hour.rhtml
  3. 4
      assets/javascripts/deliverables.js

@ -38,7 +38,7 @@
end %> end %>
</td> </td>
<td class="delete"> <td class="delete">
<%= image_to_function 'delete.png', "deleteDeliverableCost('#{id_prefix}')" %> <%= link_to_function image_tag('delete.png'), "deleteDeliverableCost('#{id_prefix}')" %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

@ -35,7 +35,7 @@
<%= observe_field( "#{id_prefix}_hours", :frequency => 1, :url => {:action => :update_deliverable_hour}, :with => "'user_id=' + encodeURIComponent(document.getElementById('#{id_prefix}_user_id').value) + '&hours=' + encodeURIComponent(value) + '&fixed_date=' + encodeURIComponent(document.getElementById('deliverable_fixed_date').value) + '&element_id=#{id_prefix}'") %> <%= observe_field( "#{id_prefix}_hours", :frequency => 1, :url => {:action => :update_deliverable_hour}, :with => "'user_id=' + encodeURIComponent(document.getElementById('#{id_prefix}_user_id').value) + '&hours=' + encodeURIComponent(value) + '&fixed_date=' + encodeURIComponent(document.getElementById('deliverable_fixed_date').value) + '&element_id=#{id_prefix}'") %>
</td> </td>
<td class="delete" rowspan="2"> <td class="delete" rowspan="2">
<%= image_to_function 'delete.png', "deleteDeliverableHour('#{id_prefix}')" %> <%= link_to_function image_tag('delete.png'), "deleteDeliverableHour('#{id_prefix}')" %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

@ -7,7 +7,6 @@ function deleteDeliverableCost(id) {
Element.stopObserving (id + '_units') Element.stopObserving (id + '_units')
// delete the row // delete the row
e.next().remove();
e.remove(); e.remove();
// fix the markup classes // fix the markup classes
@ -16,14 +15,13 @@ function deleteDeliverableCost(id) {
function deleteDeliverableHour(id) { function deleteDeliverableHour(id) {
var e = $(id), var e = $(id),
parent = e.up(); parent = e.up();
// de-register observers // de-register observers
Element.stopObserving (id + '_user_id') Element.stopObserving (id + '_user_id')
Element.stopObserving (id + '_hours') Element.stopObserving (id + '_hours')
// delete the row // delete the row
e.next().remove();
e.remove(); e.remove();
// fix the markup classes // fix the markup classes

Loading…
Cancel
Save