Bug 7948 - Printing transfer slip loses barcode field focus
authorKyle M Hall <kyle@bywatersolutions.com>
Thu, 12 Apr 2012 15:16:20 +0000 (11:16 -0400)
committerPaul Poulain <paul.poulain@biblibre.com>
Tue, 22 May 2012 10:36:02 +0000 (12:36 +0200)
  * Refocus on barcode field after running Dopop()
  * Cleaned up javascript, removed tabs

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
passes t xt
works as advertised.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt

index d5e1b98..835724f 100644 (file)
@@ -5,40 +5,42 @@
 <script type="text/javascript">
 //<![CDATA[
 function Dopop(link) {
-    var newin=window.open(link,'popup','width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
+    var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
+    $("#barcode").focus();
 }
-        $(document).ready(function() {
-               $("#exemptcheck").change(function(){
-                       if(this.checked == true) {
-                               $("#barcode").addClass("alert");
-                               $("#exemptfines").show();
-                       } else {
-                               $("#barcode").removeClass("alert");
-                               $("#exemptfines").hide();
-                       }
-                       $("#barcode").focus();
-               });
-               $("#dropboxcheck").change(function(){
-                       if (this.checked == true) {
-                               $("#barcode").addClass("alert");
-                               $("#dropboxmode").show();
-                       } else {
-                               $("#barcode").removeClass("alert");
-                               $("#dropboxmode").hide();
-                       }
-                       $("#barcode").focus();
-               });
-               [% IF ( overduecharges ) %]$("#barcode").focus(function(){
-                       if(($("#exemptcheck").attr("checked") == true)||($("#dropboxcheck").attr("checked") == true)){
-                               $("#barcode").addClass("alert");
-                       } else {
-                               $("#barcode").removeClass("alert");
-                       }
-               });
-               $("#barcode").blur(function(){
-                       $("#barcode").removeClass("alert");
-               });[% END %]
-        });
+$(document).ready(function () {
+    $("#exemptcheck").change(function () {
+        if (this.checked == true) {
+            $("#barcode").addClass("alert");
+            $("#exemptfines").show();
+        } else {
+            $("#barcode").removeClass("alert");
+            $("#exemptfines").hide();
+        }
+        $("#barcode").focus();
+    });
+    $("#dropboxcheck").change(function () {
+        if (this.checked == true) {
+            $("#barcode").addClass("alert");
+            $("#dropboxmode").show();
+        } else {
+            $("#barcode").removeClass("alert");
+            $("#dropboxmode").hide();
+        }
+        $("#barcode").focus();
+    });
+    [% IF(overduecharges) %] $("#barcode").focus(function () {
+        if (($("#exemptcheck").attr("checked") == true) || ($("#dropboxcheck").attr("checked") == true)) {
+            $("#barcode").addClass("alert");
+        } else {
+            $("#barcode").removeClass("alert");
+        }
+    });
+    $("#barcode").blur(function () {
+        $("#barcode").removeClass("alert");
+    });
+    [% END %]
+});
 //]]>
 </script>
 </head>