BorisMoore / jsviews

Interactive data-driven views, MVVM and MVP, built on top of JsRender templates
http://www.jsviews.com/#jsviews
MIT License
855 stars 130 forks source link

onUnbind / onDispose not called #430

Closed johan-ohrn closed 5 years ago

johan-ohrn commented 5 years ago

I created a custom {{validate}} tag. My problem is that onUnbind is never called when it's removed from the DOM. For whatever reason onUnbind is called if you remove the {{slider}} tag from the template.

Here is a fiddle. Run it with the browser console open.

BorisMoore commented 5 years ago

Thanks for calling this out, Johan.

Here is a proposed fix:

jsviews1.0.4e.js.txt

BorisMoore commented 5 years ago

@johan-ohrn: Hi Johan, let me know if this works for you, when you can... I hope to publish the above update soon, to include this and other fixes. Also if my suggested slider widget update works for you, I will update the jsviews-jqueryui-widgets.js library too, with that update...

johan-ohrn commented 5 years ago

Hi, I won't be able to confirm until after next week. Vacation... Unfortunately I don't have access to my work from home. I'll let you know asap when I'm back. Cheers!

BorisMoore commented 5 years ago

Thanks for letting me know! Enjoy your vacation....

johan-ohrn commented 5 years ago

Could you please link this update as separate js files (jsrender, jsobservable, jsviews) ?

BorisMoore commented 5 years ago

Here it is: download.zip

johan-ohrn commented 5 years ago

I can confirm that it work - thanks!

BorisMoore commented 5 years ago

Fixed in v1.0.4