overdrive-eg-opac: fix account summary per RT#39272
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 11 May 2016 21:16:52 +0000 (14:16 -0700)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 11 May 2016 21:16:52 +0000 (14:16 -0700)
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
overdrive-eg-opac/build/od_pages_myopac.js

index 9df9183..bed358e 100644 (file)
@@ -27,18 +27,16 @@ define(['jquery-noconflict', 'lodash', 'od_config', 'jquery-ui', 'od_action', 'o
       return this;
     },
     _account_summary: function(x) {
-      var totals, tpl, v;
+      var totals, tpl, v, _i, _len, _ref;
       if (arguments.length === 0) {
-        totals = (function() {
-          var _i, _len, _ref, _results;
-          _ref = this.find('td').not('[align="right"]');
-          _results = [];
-          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
-            v = _ref[_i];
-            _results.push(+(v.textContent.match(/\d+/) ? v.textContent.match(/\d+/)[0] : void 0));
+        totals = [];
+        _ref = this.find('td').not('[align="right"]');
+        for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+          v = _ref[_i];
+          if (v.textContent.match(/\d+/) && v.textContent.match('Items')) {
+            totals.push(v.textContent.match(/\d+/)[0]);
           }
-          return _results;
-        }).call(this);
+        }
         tpl = _.template("<tbody>\n    <tr>\n          <td>\n                  <a href=\"/eg/opac/myopac/circs\">\n                            <span><span class=\"ncheckouts\" /> <%= ncheckouts %> Items Currently Checked out</span>\n                      </a>\n          </td>\n         <td align=\"right\">\n                  <a href=\"/eg/opac/myopac/circs?e_items\"><span class=\"n_checkouts\" /> E-items Currently Checked out</a>\n            </td>\n </tr>\n <tr>\n          <td>\n                  <a href=\"/eg/opac/myopac/holds\"><span class=\"nholds\" /> <%= nholds %> Items Currently on Hold</a>\n         </td>\n         <td align=\"right\">\n                  <a href=\"/eg/opac/myopac/holds?e_items\"><span class=\"n_holds\" /> E-items Currently on Hold</a>\n            </td>\n </tr>\n <tr>\n          <td>\n                  <a href=\"/eg/opac/myopac/holds?available=1\"><span class=\"nready\" /> <%= nready %> Items ready for pickup</a>\n              </td>\n         <td align=\"right\">\n                  <a href=\"/eg/opac/myopac/holds?e_items&available=1\"><span class=\"n_ready\" /> E-items ready for pickup</a>\n         </td>\n </tr>\n</tbody>");
         return this.empty().append(tpl({
           ncheckouts: totals[0],