class View extends Events

pull/1441/head
Simon Legner 1 year ago
parent bf65faea85
commit 5e0b6a4e59

@ -4,16 +4,12 @@
* decaffeinate suggestions: * decaffeinate suggestions:
* DS101: Remove unnecessary use of Array.from * DS101: Remove unnecessary use of Array.from
* DS102: Remove unnecessary code created because of implicit returns * DS102: Remove unnecessary code created because of implicit returns
* DS206: Consider reworking classes to avoid initClass
* DS207: Consider shorter variations of null checks * DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/ */
app.View = class View { app.View = class View extends Events {
static initClass() {
$.extend(this.prototype, Events);
}
constructor(el) { constructor(el) {
super();
if (el instanceof HTMLElement) { if (el instanceof HTMLElement) {
this.el = el; this.el = el;
} }
@ -27,8 +23,8 @@ app.View = class View {
this.refreshElements(); this.refreshElements();
if (typeof this.init === "function") { if (typeof this.init === "function") {
this.init(); this.init();
this.refreshElements();
} }
this.refreshElements();
} }
setupElement() { setupElement() {
@ -260,4 +256,3 @@ app.View = class View {
$.remove(this.el); $.remove(this.el);
} }
}; };
app.View.initClass();

Loading…
Cancel
Save