Commit 4256692c authored by tobinski's avatar tobinski
Browse files

Add depth attribute to the widget.

parent d395f8b7
......@@ -91,6 +91,9 @@
<h3 slot="title">Example 10: Links (similarto) from geolinker dodis: Diedenhofen with credits</h3>
<p slot="credits">Example credits</p>
</histhub-widget>
<histhub-widget endpoint="//api.geolinker.histhub.ch/v2/sameas/" resolver="resolverneo4j" location="https://dodis.ch/G8656" depth="2">
<h3 slot="title">Example 11: Links (similarto) from geolinker dodis: Diedenhofen with depth 2</h3>
</histhub-widget>
</div>
</body>
</html>
......@@ -172,12 +172,13 @@
const language = this.getAttribute('language') || null;
const timeout = this.getAttribute('timeout') || null;
const location = this.getAttribute('location') || window.location.href;
const depth = this.getAttribute('depth') || 1;
this.linkTarget = this.getAttribute('link-target') || '_blank';
if (typeof url === 'undefined' || typeof resolver === 'undefined' || typeof location === 'undefined') {
throw new Error("Missing required parameters");
}
try {
await this.fetchLinks(url, resolver, location, {language, timeout});
await this.fetchLinks(url, resolver, location, {language, timeout, depth});
} catch(error) {
console.log(error);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment