nprapps / papertrail

Rig for deploying DocumentCloud viewers to S3.
Other
13 stars 4 forks source link

Full-screen viewer: Document title isn't loading in #56

Closed alykat closed 7 years ago

alykat commented 7 years ago

See: http://apps.npr.org/documents/document.html?id=3248864-Office-of-Government-Ethics-emails

The word "Loading..." appears instead of the document's title.

I get this error in console:

viewer.js:52 Uncaught TypeError: Cannot read property 'api' of undefined
    at Object.onDocumentLoad [as afterLoad] (app-footer.min.js:17)
    at HTMLDocument.<anonymous> (viewer.js:691)
    at Object.resolveWith (viewer.js:51)
    at ready (viewer.js:22)
jjelosua commented 7 years ago

I did not think this issue was already detected....seems like there has been a change in visibility of the viewer and afterLoad did not have a reference to the viewer generated on DV.load. I added the viewer as a passed parameter to onDocumentLoad. that seems to fix it