use disabled property for input and fix style

This commit is contained in:
wvengen 2014-01-03 10:59:42 +01:00
parent f1ae2724c6
commit 014a62aa11
3 changed files with 7 additions and 2 deletions

View file

@ -265,6 +265,10 @@ tr.unavailable {
// show package icon after amount of package numbers // show package icon after amount of package numbers
input.package { input.package {
background: url(package-bg.png) no-repeat right center; background: url(package-bg.png) no-repeat right center;
// disabled and readonly definitions though
&[disabled], &[readonly] {
background-color: @inputDisabledBackground;
}
} }
i.package { i.package {
background: url(package-bg.png) no-repeat left center; background: url(package-bg.png) no-repeat left center;
@ -275,6 +279,7 @@ i.package {
.package { .package {
color: #999; color: #999;
} }
.input-nano { .input-nano {
width: 30px; width: 30px;
} }

View file

@ -45,7 +45,7 @@ module OrdersHelper
units_expected = (order_article.units_billed or order_article.units_to_order) units_expected = (order_article.units_billed or order_article.units_to_order)
form.text_field :units_received, class: 'input-nano package units_received', form.text_field :units_received, class: 'input-nano package units_received',
data: {'units-expected' => units_expected}, data: {'units-expected' => units_expected},
readonly: order_article.result_manually_changed? ? "readonly" : nil, disabled: order_article.result_manually_changed?,
title: order_article.result_manually_changed? ? t('.locked_to_protect_manual_update') : nil, title: order_article.result_manually_changed? ? t('.locked_to_protect_manual_update') : nil,
autocomplete: 'off' autocomplete: 'off'
end end

View file

@ -62,7 +62,7 @@
} }
function unlock_receive_input_field() { function unlock_receive_input_field() {
$('.units_received', $(this).closest('tr')).prop('readonly', false); $('.units_received', $(this).closest('tr')).prop('disabled', false);
$(this).remove(); $(this).remove();
} }