nytimes / ice

track changes with javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some data should not be common to ICE instances

imdfl opened this issue · comments

the _userStyles and _styles objects of the InlineChangeTracker are shared between instances. This leads to errors when instances are supposed to work with different users. They should be set in the constructor instead of in the prototype.The _currentUser object should also be per instance, but this is a problem only in theory because of the way this member is set.

Totally agree. At one point, refactoring this was on my radar. Ideally, you should be able to instantiate multiple versions of ice in the same document/window. I think it would take more than just refactoring the elements you specified, but that is a good start. I would like to get to this at some point, and welcome any pulls.