diff --git a/src/page/basics/image-anchor/image-anchor.html.ts b/src/page/basics/image-anchor/image-anchor.html.ts index 5898193..1a58ef3 100644 --- a/src/page/basics/image-anchor/image-anchor.html.ts +++ b/src/page/basics/image-anchor/image-anchor.html.ts @@ -6,15 +6,18 @@ export const generate = ({ href, svg, title, + shouldDownload, }: { href: url; svg: url; title: string; + shouldDownload: boolean; }): html => `
${svg} diff --git a/src/page/basics/image-anchor/image-anchor.ts b/src/page/basics/image-anchor/image-anchor.ts index 84a9499..b0c3034 100644 --- a/src/page/basics/image-anchor/image-anchor.ts +++ b/src/page/basics/image-anchor/image-anchor.ts @@ -3,9 +3,13 @@ import { createElement } from '../../../helper/create-element'; import { url } from '../../../types/url'; import { generate } from './image-anchor.html'; -export const ImageAnchorFactory = (svg: string, title: string) => +export const ImageAnchorFactory = ( + svg: string, + title: string, + { shouldDownload = false }: { shouldDownload?: boolean } = {} +) => class ImageAnchor extends PageElement { public constructor(href: url) { - super(createElement(generate({ href, svg, title }))); + super(createElement(generate({ href, svg, title, shouldDownload }))); } };