diff --git a/README.md b/README.md index fa4fd9e..436dab8 100644 --- a/README.md +++ b/README.md @@ -48,16 +48,17 @@ Directly from unpkg.com # Banner Attributes -| Name | Type | Description | -| ---------------------- | --------------- | ------------------------------------------------------------------ | -| width | Number | Banner width | -| height | Number | Banner height | -| id | String | The slot ID for this banner | -| category-id* | Optional String | The category ID of the current page | -| category-ids* | Optional String | Comma (,) separated list of category IDs, the item must match all | -| category-disjunctions* | Optional String | Comma (,) separated list of category IDs, the item must match any | -| search-query | Optional String | The search query of the current page | -| location | Optional String | The location for geotargeting | +| Name | Type | Description | +| ---------------------- | ---------------- | --------------------------------------------------------------------------- | +| width | Number | Banner width | +| height | Number | Banner height | +| id | String | The slot ID for this banner | +| category-id* | Optional String | The category ID of the current page | +| category-ids* | Optional String | Comma (,) separated list of category IDs, the item must match all | +| category-disjunctions* | Optional String | Comma (,) separated list of category IDs, the item must match any | +| search-query | Optional String | The search query of the current page | +| location | Optional String | The location for geotargeting | +| new-tab | Optional Boolean | Opens the banner's link in a new tab (defaults to false) | \* Only one of `[category-id, category-ids, category-disjunctions]` must be set. If multiple are set, only the first will be considered, in that order. diff --git a/src/index.ts b/src/index.ts index dcb580b..3cf5b16 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,6 +75,9 @@ export class TopsortBanner extends LitElement { @property({ attribute: "location", type: String }) readonly location?: string; + @property({ attribute: "new-tab", type: Boolean }) + readonly newTab?: boolean; + private task = new Task(this, { task: (...args) => this.runAuction(...args), args: () => [], @@ -130,14 +133,16 @@ export class TopsortBanner extends LitElement { } `; const href = this.getLink(banner); + const imgtag = html`Topsort banner`; + const atag = this.newTab + ? html`${imgtag}` + : html`${imgtag}`; return html`
- - Topsort banner - + ${atag}
`; }