diff options
author | alexwl <alexey.a.kiryushin@gmail.com> | 2019-02-20 18:58:57 +0300 |
---|---|---|
committer | alexwl <alexey.a.kiryushin@gmail.com> | 2019-02-20 18:58:57 +0300 |
commit | eddf2c825dee199de0e958857f0daf3d08a07532 (patch) | |
tree | a2901b6273012308fb0b40a34c4610536a1da9e5 /javascript/app/components | |
parent | c831f86d259b6d949b0f71b894c7f2b07b4eed15 (diff) |
Adds an option to use public Hoogle JSON API (https://github.com/ndmitchell/hoogle/blob/3dbf68bfd701f942d3af2e6debb74a0a78cd392e/docs/API.md#json-api) to get documentation for not indexed packages. Closes #21.
Diffstat (limited to 'javascript/app/components')
-rw-r--r-- | javascript/app/components/identifier-info.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/javascript/app/components/identifier-info.js b/javascript/app/components/identifier-info.js index 537697a..bb859be 100644 --- a/javascript/app/components/identifier-info.js +++ b/javascript/app/components/identifier-info.js @@ -54,8 +54,19 @@ export default Ember.Component.extend({ Ember.run.next(this,() => { if(currentIdentifier === this.get('identifierInfo')) { this.set('downloadedDocumentation',definitionSite.documentation); - }}); - }); + }}) + }).catch(() => { + this.get('store').loadHoogleDocs(packageId, + locationInfo.moduleName, + locationInfo.entity, + locationInfo.name) + .then((hoogleDocs) => { + Ember.run.next(this,() => { + if(currentIdentifier === this.get('identifierInfo')) { + this.set('downloadedDocumentation',hoogleDocs); + }}); + }); + });; } } }) |