From: senator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 1 Feb 2011 21:39:06 +0000 (+0000)
Subject: Acq: Improving on r19351, don't let showCreatePane() be issued repeatedly to
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6725150bcbd291defda846fadeb0e4751a71bdc1;p=evergreen%2Fmasslnc.git

Acq: Improving on r19351, don't let showCreatePane() be issued repeatedly to
fill the window with redundant dialogs, since a) it looks silly, and b) the
dialogs don't work when there are more than one of them. Thanks again Dan.


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

diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
index aceff7e2c2..94f24bfa4b 100644
--- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
+++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
@@ -46,6 +46,7 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                 this.attr('structure', this._compileStructure());
                 this.setStore(this.buildAutoStore());
                 this.cachedQueryOpts = {};
+                this._showing_create_pane = false;
 
                 if(this.showColumnPicker) {
                     if(!this.columnPickerPrefix) {
@@ -527,8 +528,15 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
             },
 
             showCreatePane : function() {
+                if (this._showing_create_pane)
+                    return;
+                this._showing_create_pane = true;
+
                 var self = this;
-                var done = function() { self.hidePane(); };
+                var done = function() {
+                    self._showing_create_pane = false;
+                    self.hidePane();
+                };
                 dojo.style(this.domNode, 'display', 'none');
                 this.editPane = this._makeCreatePane(done, done);
                 this.editPane.startup();