From af35c40c8f0de2f9fa84671a3c44e97970248b43 Mon Sep 17 00:00:00 2001 From: hjust Date: Thu, 17 Sep 2009 10:26:36 +0000 Subject: [PATCH] * 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 --- app/views/deliverables/_deliverable_cost.rhtml | 2 +- app/views/deliverables/_deliverable_hour.rhtml | 2 +- assets/javascripts/deliverables.js | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/views/deliverables/_deliverable_cost.rhtml b/app/views/deliverables/_deliverable_cost.rhtml index b4f19211d6..141d046acc 100644 --- a/app/views/deliverables/_deliverable_cost.rhtml +++ b/app/views/deliverables/_deliverable_cost.rhtml @@ -38,7 +38,7 @@ end %> - <%= image_to_function 'delete.png', "deleteDeliverableCost('#{id_prefix}')" %> + <%= link_to_function image_tag('delete.png'), "deleteDeliverableCost('#{id_prefix}')" %> <% end %> diff --git a/app/views/deliverables/_deliverable_hour.rhtml b/app/views/deliverables/_deliverable_hour.rhtml index 80d5579b7e..770c1cd41c 100644 --- a/app/views/deliverables/_deliverable_hour.rhtml +++ b/app/views/deliverables/_deliverable_hour.rhtml @@ -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}'") %> - <%= image_to_function 'delete.png', "deleteDeliverableHour('#{id_prefix}')" %> + <%= link_to_function image_tag('delete.png'), "deleteDeliverableHour('#{id_prefix}')" %> <% end %> diff --git a/assets/javascripts/deliverables.js b/assets/javascripts/deliverables.js index f83755ecc0..505593b017 100644 --- a/assets/javascripts/deliverables.js +++ b/assets/javascripts/deliverables.js @@ -7,7 +7,6 @@ function deleteDeliverableCost(id) { Element.stopObserving (id + '_units') // delete the row - e.next().remove(); e.remove(); // fix the markup classes @@ -16,14 +15,13 @@ function deleteDeliverableCost(id) { function deleteDeliverableHour(id) { var e = $(id), - parent = e.up(); + parent = e.up(); // de-register observers Element.stopObserving (id + '_user_id') Element.stopObserving (id + '_hours') // delete the row - e.next().remove(); e.remove(); // fix the markup classes