Bug 10875: (follow-up) make displaying/hiding inactive funds work cross-browser
authorGalen Charlton <gmc@esilibrary.com>
Sun, 4 May 2014 21:55:02 +0000 (21:55 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 4 May 2014 21:55:02 +0000 (21:55 +0000)
This uses the idea introduced by the patch for bug 8659 by Maxime
Pelletier.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt

index 5bf71e9..6f51956 100644 (file)
             "aaSorting": []
         } ) );
 
-        $("select[name='all_budget_id'] .b_inactive").hide();
-        $("select[name='budget_id'] .b_inactive").hide();
+        // keep copy of the inactive budgets
+        disabledBudgetsCopy = $("select[name='all_budget_id']").html();
+        $("select[name='all_budget_id'] .b_inactive").remove();
+        $("select[name='budget_id'] .b_inactive").remove();
 
         $("#showallbudgets").click(function() {
             if ($(this).is(":checked")) {
-                $("select[name='budget_id'] .b_inactive").show();
+                $("select[name='budget_id']").html(disabledBudgetsCopy)
             }
             else {
-                $("select[name='budget_id'] .b_inactive").hide();
+                $("select[name='budget_id'] .b_inactive").remove();
             }
         });
 
         $("#all_showallbudgets").click(function() {
             if ($(this).is(":checked")) {
-                $("select[name='all_budget_id'] .b_inactive").show();
+                $("select[name='all_budget_id']").html(disabledBudgetsCopy);
             }
             else {
-                $("select[name='all_budget_id'] .b_inactive").hide();
+                $("select[name='all_budget_id'] .b_inactive").remove();
             }
         });