From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Fri, 22 Apr 2011 15:56:53 +0000 (+0000)
Subject: Don't disable the Create Volume/Item button when building the data structure from... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c995a24ff27e7a38ed52b9a6638ea0a3bdd8ba54;p=evergreen%2Fjoelewis.git

Don't disable the Create Volume/Item button when building the data structure from the form.

If you have say, a <textbox> with on onchange event that disables a <button> and re-enables it shortly thereafter, and the onchange event was triggered by you clicking on said button while the textbox has focus/changes, then the disable action will prevent any click on the button from registering.


git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_2_1@20286 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
index e394dfbb49..ad3ce0eaef 100644
--- a/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
+++ b/Open-ILS/xul/staff_client/server/cat/volume_copy_creator.js
@@ -776,11 +776,10 @@ g.delay_gather_copies_soon = function() {
     }
 }
 
-g.gather_copies_soon = function() {
+g.gather_copies_soon = function(ev) {
     try {
         if (!xulG.unified_interface) { return; }
         dump('g.gather_copies_soon()\n');
-        document.getElementById("Create").disabled = true;
         if (g.update_copy_editor_timeoutID) {
             clearTimeout(g.update_copy_editor_timeoutID);
         }
@@ -791,9 +790,8 @@ g.gather_copies_soon = function() {
                 try {
                     g.gather_copies();
                     xulG.refresh_copy_editor();
-                    document.getElementById("Create").disabled = false;
                 } catch(E) {
-                    alert('Error in volume_copy_editor.js with g.gather_copies_soon setTimeout func(): ' + E);
+                    dump('Error in volume_copy_editor.js with g.gather_copies_soon setTimeout func(): ' + E + '\n');
                 }
             }, update_timer
         );
@@ -1075,8 +1073,14 @@ g.stash_and_close = function(param) {
 
     try {
 
+        if (g.update_copy_editor_timeoutID) {
+            clearTimeout(g.update_copy_editor_timeoutID);
+        }
+
         var copies;
         if (xulG.unified_interface) {
+            g.gather_copies();
+            xulG.refresh_copy_editor();
             copies = xulG.copies;
         } else {
             copies = g.gather_copies();