[open-ils-commits] r12927 - in trunk/Open-ILS/web: js/dojo/openils/widget js/ui/default/acq/common js/ui/default/acq/picklist templates/default/acq/common (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Apr 20 16:06:07 EDT 2009


Author: erickson
Date: 2009-04-20 16:06:00 -0400 (Mon, 20 Apr 2009)
New Revision: 12927

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js
   trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
   trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js
   trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
Log:
simplify progress dialog.  pass true to show to make it indeterminate

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js	2009-04-20 20:04:11 UTC (rev 12926)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js	2009-04-20 20:06:00 UTC (rev 12927)
@@ -17,20 +17,25 @@
             startup : function() {
                 this.inherited(arguments);
                 this.progress = new dijit.ProgressBar();
-                this.progress.indeterminate = this.indeterminate;
                 this.progress.startup();
                 openils.Util.addCSSClass(this.progress.domNode, 'oils-progress-dialog');
                 this.containerNode.appendChild(this.progress.domNode);
-                if(this.indeterminate) this.update();
             },
 
             update : function() {
                 this.progress.update.apply(this.progress, arguments);
             },
 
-            setInd : function(isInd) {
-                this.progress.indeterminate = this.indeterminate = isInd;
-            }
+            show : function(ind) {
+                if(ind || this.indeterminate) {
+                    this.progress.indeterminate = true;
+                    this.update();
+                } else {
+                    this.progress.indeterminate = false;
+                }
+                    
+                this.inherited(arguments);
+            },
         }
     );
 }

Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2009-04-20 20:04:11 UTC (rev 12926)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2009-04-20 20:06:00 UTC (rev 12927)
@@ -670,13 +670,13 @@
 
     this.printPO = function() {
         if(!this.isPO) return;
-        progressDialogInd.show();
+        progressDialog.show(true);
         fieldmapper.standardRequest(
             ['open-ils.acq', 'open-ils.acq.purchase_order.format'],
             {   async: true,
                 params: [this.authtoken, this.isPO, 'html'],
                 oncomplete: function(r) {
-                    progressDialogInd.hide();
+                    progressDialog.hide();
                     var evt = openils.Util.readResponse(r);
                     if(evt && evt.template_output()) {
                         win = window.open('','', 'resizable,width=800,height=600,scrollbars=1');
@@ -706,14 +706,14 @@
 
     this.receiveLi = function(li) {
         if(!this.isPO) return;
-        progressDialogInd.show();
+        progressDialog.show(true);
         fieldmapper.standardRequest(
             ['open-ils.acq', 'open-ils.acq.lineitem.receive'],
             {   async: true,
                 params: [this.authtoken, li.id()],
                 onresponse : function(r) {
                     var resp = openils.Util.readResponse(r);
-                    progressDialogInd.hide();
+                    progressDialog.hide();
                 },
             }
         );
@@ -721,14 +721,14 @@
 
     this.receiveLid = function(li) {
         if(!this.isPO) return;
-        progressDialogInd.show();
+        progressDialog.show(true);
         fieldmapper.standardRequest(
             ['open-ils.acq', 'open-ils.acq.lineitem_detail.receive'],
             {   async: true,
                 params: [this.authtoken, li.id()],
                 onresponse : function(r) {
                     var resp = openils.Util.readResponse(r);
-                    progressDialogInd.hide();
+                    progressDialog.hide();
                 },
             }
         );

Modified: trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js	2009-04-20 20:04:11 UTC (rev 12926)
+++ trunk/Open-ILS/web/js/ui/default/acq/picklist/view_list.js	2009-04-20 20:06:00 UTC (rev 12927)
@@ -72,9 +72,7 @@
     return dojo.date.locale.format(date, {formatLength:'short'});
 }
 function deleteFromGrid() {
-    progressDialog.setInd(true);
-    progressDialog.update();
-    progressDialog.show();
+    progressDialog.show(true);
     var list = [];
     dojo.forEach(
         plListGrid.getSelectedItems(), 
@@ -94,7 +92,6 @@
     var plId = plListGrid.store.getValue(item, 'id');
     var entryCount = Number(plListGrid.store.getValue(item, 'entry_count'));
 
-    progressDialog.setInd(false);
     progressDialog.show();
     progressDialog.update({maximum:entryCount, progress:0});
 
@@ -155,7 +152,6 @@
         }
     );
 
-    progressDialog.setInd(false);
     progressDialog.show();
     progressDialog.update({maximum:totalLi, progress:0});
 

Modified: trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2009-04-20 20:04:11 UTC (rev 12926)
+++ trunk/Open-ILS/web/templates/default/acq/common/li_table.tt2	2009-04-20 20:06:00 UTC (rev 12927)
@@ -334,7 +334,6 @@
 
     <div class='hidden'>
         <div dojoType='openils.widget.ProgressDialog' jsId='progressDialog'/>
-        <div dojoType='openils.widget.ProgressDialog' jsId='progressDialogInd' indeterminate='true'/>
     </div>
 
 </div>



More information about the open-ils-commits mailing list