From dbb48c936de0fd6c6c87551841fc98121fc9af6c Mon Sep 17 00:00:00 2001 From: Maxime Pelletier Date: Tue, 21 Aug 2012 18:02:31 -0400 Subject: [PATCH] Bug 8659 Remove and readd the inactive funds in javascript to make it work in all browsers Signed-off-by: Owen Leonard Signed-off-by: Paul Poulain Signed-off-by: Chris Cormack --- .../prog/en/modules/acqui/neworderempty.tt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt index 8cd0c35a7b..dfa6dac51b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt @@ -130,13 +130,16 @@ $(document).ready(function() }); [% END %] + //keep a copy of all budgets before removing the inactives + disabledBudgetsCopy = $('#budget_id').html(); + $('#budget_id .b_inactive').remove(); + $('#showallbudgets').click(function() { - if ( $('#budget_id .b_inactive').is(":visible") ) - { - $('#budget_id .b_inactive').hide(); + if ($(this).is(":checked")) { + $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds } else { - $('#budget_id .b_inactive').show(); + $('#budget_id .b_inactive').remove(); } }); }); @@ -402,7 +405,7 @@ $(document).ready(function() [% ELSE %] [% IF ( budget_loo.b_active ) %] - [% ELSE %] + [% ELSE %] [% END %] [% END %] [% END %] -- 2.39.5