From 2fe385eb633ed32dac04d0ce39cda90b35725e72 Mon Sep 17 00:00:00 2001 From: Jeff Davis Date: Wed, 11 May 2016 14:19:39 -0700 Subject: [PATCH] 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 --- src/od_pages_myopac.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 """ -- 2.11.0