From eddf2c825dee199de0e958857f0daf3d08a07532 Mon Sep 17 00:00:00 2001 From: alexwl Date: Wed, 20 Feb 2019 18:58:57 +0300 Subject: 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. --- javascript/app/components/identifier-info.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'javascript/app/components') 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); + }}); + }); + });; } } }) -- cgit v1.2.3