"warning": "color: #c93;"
};
+/* True if the user clicks Return after saving LID changes before
+ * the LID update has completed. Setting this helps avoid re-fetching
+ * copies after the user has navigated away from the copy grid */
+var ignoreCopyUpdateResponse = false;
+
function AcqLiTable() {
var self = this;
dojo.byId('acq-lit-select-toggle').onclick = function(){self.toggleSelect()};
dojo.byId('acq-lit-info-back-button').onclick = function(){self.show('list')};
- dojo.byId('acq-lit-copies-back-button').onclick = function(){self.show('list')};
dojo.byId('acq-lit-notes-back-button').onclick = function(){self.show('list')};
dojo.byId('acq-lit-real-copies-back-button').onclick = function(){self.show('list')};
+ dojo.byId('acq-lit-copies-back-button').onclick = function(){
+ ignoreCopyUpdateResponse = true;
+ self.show('list')
+ };
+
this.reset = function(keep_selectors) {
while(self.tbody.childNodes[0])
self.tbody.removeChild(self.tbody.childNodes[0]);
this._copy_count_cb(liId, total);
openils.Util.show("acq-lit-update-copies-progress");
+ ignoreCopyUpdateResponse = false;
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.lineitem_detail.cud.batch'],
{ async: true,
litUpdateCopiesProgress.update(res);
},
oncomplete: function() {
- self.drawCopies(liId, true /* force_fetch */);
openils.Util.hide("acq-lit-update-copies-progress");
+ if (ignoreCopyUpdateResponse) {
+ console.log("ignoreCopyUpdateResponse = true");
+ ignoreCopyUpdateResponse = false;
+ return;
+ }
+ self.drawCopies(liId, true /* force_fetch */);
}
}
);