From a0cd07a91441a6c34dfeb985169f8b3def61503b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 22 May 2012 11:31:32 +0200 Subject: [PATCH] Bug 8119 - Followup Show hint when disabling active currency checkbox Display the message on editing Signed-off-by: Shari Perkins Signed-off-by: Paul Poulain --- .../prog/en/modules/admin/currency.tt | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt index e2358389e3..1d327be0b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt @@ -34,20 +34,25 @@ } } + function check_currency(val) { + if ( val == 1.0 ) { + $("#active").removeAttr('disabled'); + $("#hint").html(""); + } else { + $("#active").removeAttr('checked'); + $("#active").attr('disabled','disabled'); + $("#hint").html(_("The active currency must have a rate of 1.0")); + } + } + $(document).ready(function() { new YAHOO.widget.Button("newcurrency"); // prevents users to check active with a currency != 1 $("#rate").keyup(function() { - if ( $(this).val() == 1.0 ) { - $("#active").removeAttr('disabled'); - $("#hint").html(""); - } else { - $("#active").removeAttr('checked'); - $("#active").attr('disabled','disabled'); - $("#hint").html(_("The active currency must have a rate of 1.0")); - } + check_currency( $(this).val() ); }); + check_currency( $("#rate").val() ); }); //]]> -- 2.39.5