avoid pile-up of dojo-attached event handlers for queue upload inputs
authorberick <berick@esilibrary.com>
Mon, 23 May 2011 18:17:08 +0000 (14:17 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 6 Jul 2011 18:50:54 +0000 (14:50 -0400)
Open-ILS/web/js/ui/default/vandelay/vandelay.js

index 57e220b..de1361e 100644 (file)
@@ -1032,9 +1032,13 @@ function vlFetchQueueSummary(qId, type, onload) {
     );
 }
 
+var _importCancelHandler;
+var _importGoHandler;
 function vlHandleQueueItemsAction(action) {
 
-    dojo.connect(
+    if(_importCancelHandler) dojo.disconnect(_importCancelHandler);
+
+    _importCancelHandler = dojo.connect(
         queueItemsImportCancelButton, 
         'onClick', 
         function() {
@@ -1042,7 +1046,10 @@ function vlHandleQueueItemsAction(action) {
         }
     );
 
-    dojo.connect(
+    if(_importGoHandler)
+        dojo.disconnect(_importGoHandler);
+
+    _importGoHandler = dojo.connect(
         queueItemsImportGoButton,
         'onClick', 
         function() {