[#4180] Hide the full total input and clear it on changes.
This commit is contained in:
1 parent
545c2e06e5
commit
766072fb36
2 files changed
+9
-4
No files matched your search
@@ -3,9 +3,11 @@ jQuery(function($) {
|
|||||||
var deliverableType = $('select#deliverable_type option:selected').val();
|
var deliverableType = $('select#deliverable_type option:selected').val();
|
||||||
|
|
||||||
if (deliverableType == 'FixedDeliverable') {
|
if (deliverableType == 'FixedDeliverable') {
|
||||||
$('#deliverable_total').show();
|
$('#deliverable_total_input').show();
|
||||||
} else {
|
} else {
|
||||||
$('#deliverable_total').hide();
|
$('#deliverable_total_input').
|
||||||
|
children('#deliverable_total').val('').end().
|
||||||
|
hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -91,9 +91,10 @@ class DeliverablesNewTest < ActionController::IntegrationTest
|
|||||||
fill_in "End Date", :with => '2010-12-31'
|
fill_in "End Date", :with => '2010-12-31'
|
||||||
fill_in "Notes", :with => 'Some notes on the deliverable'
|
fill_in "Notes", :with => 'Some notes on the deliverable'
|
||||||
|
|
||||||
assert js("jQuery('#deliverable_total').is(':hidden')"),
|
# Hide and clear the total
|
||||||
|
assert js("jQuery('#deliverable_total_input').is(':hidden')"),
|
||||||
"Total is visible when it should be hidden"
|
"Total is visible when it should be hidden"
|
||||||
|
|
||||||
click_button "Save"
|
click_button "Save"
|
||||||
|
|
||||||
assert_response :success
|
assert_response :success
|
||||||
@@ -106,6 +107,8 @@ class DeliverablesNewTest < ActionController::IntegrationTest
|
|||||||
assert_equal '2010-01-01', @deliverable.start_date.to_s
|
assert_equal '2010-01-01', @deliverable.start_date.to_s
|
||||||
assert_equal '2010-12-31', @deliverable.end_date.to_s
|
assert_equal '2010-12-31', @deliverable.end_date.to_s
|
||||||
assert_equal @manager, @deliverable.manager
|
assert_equal @manager, @deliverable.manager
|
||||||
|
assert_equal nil, @deliverable.total
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user