From bffb584c0afc807209253c59765f132dabe7ab2b Mon Sep 17 00:00:00 2001 From: erickson Date: Sun, 22 Mar 2009 23:37:59 +0000 Subject: [PATCH] clear batch edit widgets on page re-draw. some css cleanup git-svn-id: svn://svn.open-ils.org/ILS/trunk@12641 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/css/skin/default/acq.css | 3 ++- Open-ILS/web/js/ui/default/acq/common/li_table.js | 18 +++++++++++------- Open-ILS/web/templates/default/acq/common/li_table.tt2 | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Open-ILS/web/css/skin/default/acq.css b/Open-ILS/web/css/skin/default/acq.css index 32fbeb314..301b5428b 100644 --- a/Open-ILS/web/css/skin/default/acq.css +++ b/Open-ILS/web/css/skin/default/acq.css @@ -97,7 +97,8 @@ .acq-lit-row { border-bottom: 1px solid #AAA; } .acq-lit-alt-row td { padding-left:30px; } #acq-lit-info-tbody td {padding:5px;} -#acq-lit-li-details-table {margin-top:25px;} +#acq-lit-li-details-table {margin-top:20px;} #acq-lit-li-details-table td {padding:0px 10px 0px 10px;} #acq-lit-li-details-table th {padding:0px 10px 0px 10px; font-weight:bold;} .acq-lit-li-menu-bar {width:99%; text-align:left; border:1px solid #aaa; margin:5px 0px 10px 0px;} +.acq-lit-table-spacer { height:20px; } 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 d3a98de81..3b547e617 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 @@ -19,6 +19,7 @@ function AcqLiTable() { this.copyTbody = dojo.byId('acq-lit-li-details-tbody'); this.copyRow = this.copyTbody.removeChild(dojo.byId('acq-lit-li-details-row')); this.copyBatchRow = dojo.byId('acq-lit-li-details-batch-row'); + this.copyBatchWidgets = {}; dojo.byId('acq-lit-select-toggle').onclick = function(){self.toggleSelect()}; dojo.byId('acq-lit-info-back-button').onclick = function(){self.show('list')}; @@ -190,7 +191,7 @@ function AcqLiTable() { var self = this; this.copyCache = {}; this.copyWidgetCache = {}; - this.copyBatchWidgets = {}; + acqLitSaveCopies.onClick = function() { self.saveCopyChanges(liId) }; acqLitBatchUpdateCopies.onClick = function() { self.batchCopyUpdate() }; @@ -198,21 +199,24 @@ function AcqLiTable() { this.copyTbody.removeChild(this.copyTbody.childNodes[0]); var row = this.copyBatchRow; - if(!this.copyBatchRowDrawn) { - dojo.forEach(['fund', 'owning_lib', 'location'], - function(field) { + dojo.forEach(['fund', 'owning_lib', 'location'], + function(field) { + if(self.copyBatchRowDrawn) { + self.copyBatchWidgets[field].attr('value', null); + } else { var widget = new openils.widget.AutoFieldWidget({ fmField : field, fmClass : 'acqlid', parentNode : dojo.query('[name='+field+']', row)[0], orgLimitPerms : ['CREATE_PICKLIST'], + dijitArgs : {required:false} }); widget.build(); self.copyBatchWidgets[field] = widget.widget; } - ); - this.copyBatchRowDrawn = true; - }; + } + ); + this.copyBatchRowDrawn = true; openils.acq.Lineitem.fetchAttrDefs( 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 a0b293575..52f112fa2 100644 --- a/Open-ILS/web/templates/default/acq/common/li_table.tt2 +++ b/Open-ILS/web/templates/default/acq/common/li_table.tt2 @@ -118,7 +118,7 @@ - + Owning Branch -- 2.11.0