Skip to content

Commit

Permalink
Customizable attributes for Hotspots
Browse files Browse the repository at this point in the history
Sometimes more than just the target attribute needs to be customized on the hotspot. Expansion of ba35ea8

Hotspots now accept an object with a list of attributes to append to the anchor tag.
  • Loading branch information
DLar authored and mpetroff committed Sep 1, 2018
1 parent 4d1c54f commit f07910d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/js/pannellum.js
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,13 @@ function createHotSpot(hs) {
} else if (hs.URL) {
a = document.createElement('a');
a.href = sanitizeURL(hs.URL);
a.target = hs.target ? hs.target : '_blank';
if (hs.attributes) {
for (var key in hs.attributes) {
a.setAttribute(key, hs.attributes[key]);
}
} else {
a.target = '_blank';
}
renderContainer.appendChild(a);
div.className += ' pnlm-pointer';
span.className += ' pnlm-pointer';
Expand Down

0 comments on commit f07910d

Please sign in to comment.