From 042895a5852cc3eb332860cb543525b07592414d Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 20 Apr 2009 20:06:00 +0000 Subject: [PATCH] simplify progress dialog. pass true to show to make it indeterminate 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 | 15 ++++++++++----- Open-ILS/web/js/ui/default/acq/common/li_table.js | 12 ++++++------ Open-ILS/web/js/ui/default/acq/picklist/view_list.js | 6 +----- Open-ILS/web/templates/default/acq/common/li_table.tt2 | 1 - 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js b/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js index 2365d33a6..8429ca38f 100644 --- a/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js +++ b/Open-ILS/web/js/dojo/openils/widget/ProgressDialog.js @@ -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); + }, } ); } diff --git a/Open-ILS/web/js/ui/default/acq/common/li_table.js b/Open-ILS/web/js/ui/default/acq/common/li_table.js index 05d885217..19ce27085 100644 --- a/Open-ILS/web/js/ui/default/acq/common/li_table.js +++ b/Open-ILS/web/js/ui/default/acq/common/li_table.js @@ -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(); }, } ); diff --git a/Open-ILS/web/js/ui/default/acq/picklist/view_list.js b/Open-ILS/web/js/ui/default/acq/picklist/view_list.js index 5c2ad4646..8e7ba88dc 100644 --- a/Open-ILS/web/js/ui/default/acq/picklist/view_list.js +++ b/Open-ILS/web/js/ui/default/acq/picklist/view_list.js @@ -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}); diff --git a/Open-ILS/web/templates/default/acq/common/li_table.tt2 b/Open-ILS/web/templates/default/acq/common/li_table.tt2 index e24f8e45b..9be7b0570 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -334,7 +334,6 @@