Wyrzucenie init z konstruktora
This commit is contained in:
@@ -64,7 +64,7 @@ Warto gdzieś później zapisać nową nazwę klasy np w opisie komponentu, albo
|
|||||||
### Przykłady UŻYCIA ###
|
### Przykłady UŻYCIA ###
|
||||||
##### Jedna ramka - obiekt ######
|
##### Jedna ramka - obiekt ######
|
||||||
```
|
```
|
||||||
new IdmHotspot({
|
const hotspot = new IdmHotspot({
|
||||||
id: "idmTestHotspot1",
|
id: "idmTestHotspot1",
|
||||||
title: "tescik",
|
title: "tescik",
|
||||||
placement: {
|
placement: {
|
||||||
@@ -78,6 +78,8 @@ new IdmHotspot({
|
|||||||
callbackFn: (hotspot)=>{console.log(hotspot)},
|
callbackFn: (hotspot)=>{console.log(hotspot)},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
hotspot.init();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
3
klasa.js
3
klasa.js
@@ -612,7 +612,6 @@ class IdmHotspot {
|
|||||||
this.handleHideSecondImage = this.handleHideSecondImage.bind(this);
|
this.handleHideSecondImage = this.handleHideSecondImage.bind(this);
|
||||||
this.handleSelectVersion = this.handleSelectVersion.bind(this);
|
this.handleSelectVersion = this.handleSelectVersion.bind(this);
|
||||||
this.handleSelectSize = this.handleSelectSize.bind(this);
|
this.handleSelectSize = this.handleSelectSize.bind(this);
|
||||||
this.init();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================================
|
// ========================================================
|
||||||
@@ -1421,7 +1420,6 @@ class IdmHotspot {
|
|||||||
}/settings.html?comparers=add&product=${compareId}`;
|
}/settings.html?comparers=add&product=${compareId}`;
|
||||||
|
|
||||||
const res = await fetch(compareUrl);
|
const res = await fetch(compareUrl);
|
||||||
console.log(res);
|
|
||||||
if (!res.ok) throw new Error(`${idmHotspotTextObject["Wystąpił błąd"]}`);
|
if (!res.ok) throw new Error(`${idmHotspotTextObject["Wystąpił błąd"]}`);
|
||||||
|
|
||||||
compareBtnEl.classList.add("--success");
|
compareBtnEl.classList.add("--success");
|
||||||
@@ -2390,7 +2388,6 @@ class IdmHotspot {
|
|||||||
app_shop.run(
|
app_shop.run(
|
||||||
() => {
|
() => {
|
||||||
this.init();
|
this.init();
|
||||||
console.log("test", this.hotspotEl);
|
|
||||||
},
|
},
|
||||||
"all",
|
"all",
|
||||||
"#Basket",
|
"#Basket",
|
||||||
|
|||||||
Reference in New Issue
Block a user