simplify progress dialog. pass true to show to make it indeterminate
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Apr 2009 20:06:00 +0000 (20:06 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 20 Apr 2009 20:06:00 +0000 (20:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12927 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js
Open-ILS/web/js/ui/default/acq/common/li_table.js
Open-ILS/web/js/ui/default/acq/picklist/view_list.js
Open-ILS/web/templates/default/acq/common/li_table.tt2

index 2365d33..8429ca3 100644 (file)
@@ -17,20 +17,25 @@ if(!dojo._hasResource['openils.widget.ProgressDialog']) {
             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);
+            },
         }
     );
 }
index 05d8852..19ce270 100644 (file)
@@ -670,13 +670,13 @@ function AcqLiTable() {
 
     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 @@ function AcqLiTable() {
 
     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 @@ function AcqLiTable() {
 
     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();
                 },
             }
         );
index 5c2ad46..8e7ba88 100644 (file)
@@ -72,9 +72,7 @@ function getDateTimeField(rowIndex, item) {
     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 @@ function cloneSelectedPl(fields) {
     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 @@ function mergeSelectedPl(fields) {
         }
     );
 
-    progressDialog.setInd(false);
     progressDialog.show();
     progressDialog.update({maximum:totalLi, progress:0});
 
index e24f8e4..9be7b05 100644 (file)
 
     <div class='hidden'>
         <div dojoType='openils.widget.ProgressDialog' jsId='progressDialog'/>
-        <div dojoType='openils.widget.ProgressDialog' jsId='progressDialogInd' indeterminate='true'/>
     </div>
 
 </div>