From 1253683b83e3854776d25e53989c6f0debf8bbc4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 2 Sep 2012 14:11:07 +0200 Subject: [PATCH] Fix: edit of percentage --- htdocs/core/class/html.formactions.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index ed6321ec47a..9435cebb1a4 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -49,7 +49,7 @@ class FormActions * Show list of action status * * @param string $formname Name of form where select in included - * @param string $selected Preselected value + * @param string $selected Preselected value (-1..100) * @param int $canedit 1=can edit, 0=read only * @param string $htmlname Name of html prefix for html fields (selectX and valX) * @return void @@ -96,15 +96,18 @@ class FormActions $('.hideifna').hide(); } else if (defaultvalue == 0) { - percentage.attr('disabled', 'disabled'); + percentage.val(0); + percentage.attr('disabled', 'disabled'); $('.hideifna').show(); } else if (defaultvalue == 100) { + percentage.val(100); percentage.attr('disabled', 'disabled'); $('.hideifna').show(); } else { - percentage.removeAttr('disabled'); + if (defaultvalue == 50 && (percentage.val() == 0 || percentage.val() == 100)) { percentage.val(50) }; + percentage.removeAttr('disabled'); $('.hideifna').show(); } }