SanomaCZ / ella-hope

Brand new admin for Ella 3+
Other
3 stars 0 forks source link

The whole app is mem-leaking (kind of) #22

Open yedpodtrzitko opened 11 years ago

yedpodtrzitko commented 11 years ago

<body> content is chained to existing one and the whole app gets slower and slower.

steps to reproduce (+example):

random clicking result (mostly articles/new article/photos/new photo):

>>> $("body")[0].innerHTML.length

3608

>>> $("body")[0].innerHTML.length

21755

>>> $("body")[0].innerHTML.length

68126

steal.js INFO:

Model.js - Model created
dev.js (line 85)

>>> $("body")[0].innerHTML.length

41909

>>> $("body")[0].innerHTML.length

32243

>>> $("body")[0].innerHTML.length

49607

>>> $("body")[0].innerHTML.length

54365

>>> $("body")[0].innerHTML.length

55835

>>> $("body")[0].innerHTML.length

60593

>>> $("body")[0].innerHTML.length

62063

>>> $("body")[0].innerHTML.length

66821

>>> $("body")[0].innerHTML.length

68291

>>> $("body")[0].innerHTML.length

73049

>>> $("body")[0].innerHTML.length

74519

>>> $("body")[0].innerHTML.length

79277

>>> $("body")[0].innerHTML.length

69611

>>> $("body")[0].innerHTML.length

86975

>>> $("body")[0].innerHTML.length

133346
yedpodtrzitko commented 11 years ago

I think problem is in datepicker plugin. Also I think it should be encapsulated via can.control.plugin (see http://canjs.us/#plugins-can_control_plugin ).

mrpohoda commented 11 years ago

When this pull request will be accepted, we set the parent element inside control's scope. Then datepicker will be removed automatically when control is destroyed.

https://github.com/elasticsales/bootstrap-datepicker/commit/5b6d9385691bda2b6a7d471e523b177692dc811c