From: Jeff Davis Date: Wed, 11 May 2016 21:19:39 +0000 (-0700) Subject: Fix account summary display in Evergreen 2.9+ X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2fe385eb633ed32dac04d0ce39cda90b35725e72;p=contrib%2Foverdrive-eg-opac.git Fix account summary display in Evergreen 2.9+ As of Evergreen 2.9, the account summary table on the main My Account page includes an additional "Account Expiration Date" row. This broke the OverDrive API integration layer. This commit takes the extra row into account when rewriting the account summary table. (As a side effect, when OverDrive API integration is enabled, the Account Expiration Date row will not be displayed on the main My Account page, but it's still visible in the Account Preferences tab.) Signed-off-by: Jeff Davis --- diff --git a/src/od_pages_myopac.coffee b/src/od_pages_myopac.coffee index 3d174d8..5bac8da 100644 --- a/src/od_pages_myopac.coffee +++ b/src/od_pages_myopac.coffee @@ -64,7 +64,10 @@ define [ if arguments.length is 0 # Parse a list of totals of physical items from the account summary table - totals = ( +(v.textContent.match(/\d+/)[0] if v.textContent.match(/\d+/)) for v in @find('td').not '[align="right"]' ) + totals = [] + for v in @find('td').not '[align="right"]' + if ( v.textContent.match(/\d+/) && v.textContent.match('Items') ) + totals.push v.textContent.match(/\d+/)[0] tpl = _.template """