Fixing default values so they are easier to overwrite with extend
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
IdmHotspot = class extends IdmHotspot {
|
||||
getDefaultHotspotOptions() {
|
||||
const defaultOptions = super.getDefaultHotspotOptions();
|
||||
defaultOptions.cssVariables.nameClamp = 2;
|
||||
|
||||
return defaultOptions;
|
||||
}
|
||||
markupLabel(prod) {
|
||||
// Standardowe labelki
|
||||
let labelMarkup = super.markupLabel(prod);
|
||||
@@ -6,11 +12,13 @@ IdmHotspot = class extends IdmHotspot {
|
||||
// Customowe labelki
|
||||
const awards = prod?.awardedParameters;
|
||||
if (awards?.length) {
|
||||
const awardParam = awards.find(award => award.name === "Idm_custom_label");
|
||||
const values = awardParam?.values?.map(v => v.name) || [];
|
||||
const awardParam = awards.find(
|
||||
(award) => award.name === "Idm_custom_label"
|
||||
);
|
||||
const values = awardParam?.values?.map((v) => v.name) || [];
|
||||
|
||||
const html = values
|
||||
.map(label => {
|
||||
.map((label) => {
|
||||
const [text, bgColor, color] = label.split("||");
|
||||
return `<span class="label --custom" style="background-color:${bgColor}; color:${color}">${text}</span>`;
|
||||
})
|
||||
@@ -21,4 +29,4 @@ IdmHotspot = class extends IdmHotspot {
|
||||
|
||||
return labelMarkup;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user