@ribajs/core
Advanced tools
Comparing version 0.18.2 to 0.18.3
{ | ||
"name": "@ribajs/core", | ||
"description": "Core module of Riba.js", | ||
"version": "0.18.2", | ||
"version": "0.18.3", | ||
"author": "Pascal Garber <pascal@jumplink.eu>", | ||
@@ -6,0 +6,0 @@ "private": false, |
@@ -33,3 +33,2 @@ /** | ||
protected view?: View; | ||
protected _bound: boolean = false; | ||
@@ -47,3 +46,3 @@ protected templateLoaded: boolean = false; | ||
public get bound() { | ||
return !!this._bound || !!this.view; | ||
return !!this.view; | ||
} | ||
@@ -74,2 +73,15 @@ | ||
/** | ||
* Remove this custom element | ||
*/ | ||
public remove() { | ||
this.debug('remove', this.el); | ||
if (this.el && this.el.parentElement) { | ||
this.el.parentElement.removeChild(this.el); | ||
if (!(window as any).customElements) { | ||
this.disconnectedFallbackCallback(); | ||
} | ||
} | ||
} | ||
public disconnectedFallbackCallback() { | ||
@@ -233,3 +245,2 @@ this.disconnectedCallback(); | ||
this.el.removeEventListener('binder-changed', this.BinderChangedEventHandler); | ||
this._bound = false; | ||
} | ||
@@ -359,3 +370,2 @@ | ||
this.view = new View(Array.prototype.slice.call(this.el.childNodes) as unknown as NodeListOf<ChildNode>, this.scope, viewOptions); | ||
this._bound = true; | ||
this.scope = this.view.models; | ||
@@ -371,2 +381,15 @@ this.view.bind(); | ||
protected async unbind() { | ||
if (this.view) { | ||
this.view.unbind(); | ||
delete this.view; | ||
} | ||
} | ||
protected async build() { | ||
if (this.view) { | ||
this.view.build(); | ||
} | ||
} | ||
protected async beforeBind(): Promise<any> { | ||
@@ -373,0 +396,0 @@ this.debug('beforeBind', this.bound); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2814406
34944