From fd7f9e90703ac6795db69018dd718561d5ebae45 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 8 Feb 2017 17:04:07 -0500 Subject: [PATCH] webstaff: rework line item sub-actions menu Since Chrome doesn't generate click events for the act of selecting an - - - - + + + + + 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 7f34f552b1..89578536fc 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 @@ -922,7 +922,6 @@ function AcqLiTable() { option.disabled = !(count || eligible); option.innerHTML = dojo.string.substitute(localeStrings.NUM_CLAIMS_EXISTING, [count]); - option.onclick = function() { self.claimDialog.show(li); }; }; this.clearEligibility = function(li) { @@ -1224,13 +1223,26 @@ function AcqLiTable() { this.updateLiState = function(li, row) { if (!row) row = this._findLiRow(li); + nodeByName("actions", row).onchange = function() { + switch(this.options[this.selectedIndex].value) { + case 'action_update_barcodes': + self.showRealCopyEditUI(li); + nodeByName("action_none", row).selected = true; + break; + case 'action_holdings_maint': + (self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser', row ))(); + break; + case 'action_manage_claims': + self.fetchClaimInfo(li.id(), true, function(full) { self.claimDialog.show(full) }, row); + break; + case 'action_view_history': + location.href = oilsBasePath + '/acq/lineitem/history/' + li.id(); + break; + } + }; var actUpdateBarcodes = nodeByName("action_update_barcodes", row); var actHoldingsMaint = nodeByName("action_holdings_maint", row); - // always allow access to LI history - nodeByName('action_view_history', row).onclick = - function() { location.href = oilsBasePath + '/acq/lineitem/history/' + li.id(); }; - /* handle row coloring for based on LI state */ openils.Util.removeCSSClass(row, /^oils-acq-li-state-/); openils.Util.addCSSClass(row, "oils-acq-li-state-" + li.state()); @@ -1262,13 +1274,7 @@ function AcqLiTable() { (lids && !lids.filter(function(lid) { return lid.eg_copy_id() })[0] )) { actUpdateBarcodes.disabled = false; - actUpdateBarcodes.onclick = function() { - self.showRealCopyEditUI(li); - nodeByName("action_none", row).selected = true; - } actHoldingsMaint.disabled = false; - actHoldingsMaint.onclick = - self.generateMakeRecTab( li.eg_bib_id(), 'copy_browser', row ); } var state_cell = nodeByName("li_state_" + li.state(), row); -- 2.11.0