Backport r19355 from trunk
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Feb 2011 21:39:37 +0000 (21:39 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Feb 2011 21:39:37 +0000 (21:39 +0000)
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/branches/rel_2_0@19356 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoGrid.js

index aceff7e..94f24bf 100644 (file)
@@ -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();