Skip to content

Commit edbeac6

Browse files
committed
[Release] v1.1.0
1 parent 23a487f commit edbeac6

File tree

7 files changed

+91
-15
lines changed

7 files changed

+91
-15
lines changed

dist/lib/en/patreon-box.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ class PatreonBox extends HTMLElement {
4141
};
4242

4343
this.options = Object.create(this.options_default);
44+
45+
this.resize_event = function(event) {
46+
this.resize(event);
47+
}.bind(this);
48+
}
49+
50+
/**
51+
* Append web component
52+
* =====================
53+
*
54+
*/
55+
connectedCallback() {
56+
window.addEventListener("resize", this.resize_event);
4457
}
4558

4659
/**
@@ -125,9 +138,6 @@ class PatreonBox extends HTMLElement {
125138
}).then(function(response) {
126139
this.json = response;
127140
this.build_html();
128-
window.addEventListener("resize", function(event) {
129-
this.resize(event);
130-
}.bind(this));
131141
}.bind(this));
132142
}
133143

@@ -154,6 +164,15 @@ class PatreonBox extends HTMLElement {
154164
}
155165
}
156166
}
167+
168+
/**
169+
* Remove web component
170+
* =====================
171+
*
172+
*/
173+
disconnectedCallback() {
174+
window.removeEventListener("resize", this.resize_event);
175+
}
157176
}
158177

159178
window.customElements.define("patreon-box", PatreonBox);

dist/lib/en/patreon-box.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lib/it/patreon-box.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ class PatreonBox extends HTMLElement {
4141
};
4242

4343
this.options = Object.create(this.options_default);
44+
45+
this.resize_event = function(event) {
46+
this.resize(event);
47+
}.bind(this);
48+
}
49+
50+
/**
51+
* Append web component
52+
* =====================
53+
*
54+
*/
55+
connectedCallback() {
56+
window.addEventListener("resize", this.resize_event);
4457
}
4558

4659
/**
@@ -125,9 +138,6 @@ class PatreonBox extends HTMLElement {
125138
}).then(function(response) {
126139
this.json = response;
127140
this.build_html();
128-
window.addEventListener("resize", function(event) {
129-
this.resize(event);
130-
}.bind(this));
131141
}.bind(this));
132142
}
133143

@@ -154,6 +164,15 @@ class PatreonBox extends HTMLElement {
154164
}
155165
}
156166
}
167+
168+
/**
169+
* Remove web component
170+
* =====================
171+
*
172+
*/
173+
disconnectedCallback() {
174+
window.removeEventListener("resize", this.resize_event);
175+
}
157176
}
158177

159178
window.customElements.define("patreon-box", PatreonBox);

dist/lib/it/patreon-box.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/lib/pl/patreon-box.js

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ class PatreonBox extends HTMLElement {
4141
};
4242

4343
this.options = Object.create(this.options_default);
44+
45+
this.resize_event = function(event) {
46+
this.resize(event);
47+
}.bind(this);
48+
}
49+
50+
/**
51+
* Append web component
52+
* =====================
53+
*
54+
*/
55+
connectedCallback() {
56+
window.addEventListener("resize", this.resize_event);
4457
}
4558

4659
/**
@@ -125,9 +138,6 @@ class PatreonBox extends HTMLElement {
125138
}).then(function(response) {
126139
this.json = response;
127140
this.build_html();
128-
window.addEventListener("resize", function(event) {
129-
this.resize(event);
130-
}.bind(this));
131141
}.bind(this));
132142
}
133143

@@ -154,6 +164,15 @@ class PatreonBox extends HTMLElement {
154164
}
155165
}
156166
}
167+
168+
/**
169+
* Remove web component
170+
* =====================
171+
*
172+
*/
173+
disconnectedCallback() {
174+
window.removeEventListener("resize", this.resize_event);
175+
}
157176
}
158177

159178
window.customElements.define("patreon-box", PatreonBox);

0 commit comments

Comments
 (0)